Skip to content

docs(round5): pipelines run() fail-loud-on-truncation note; commands.… #161

docs(round5): pipelines run() fail-loud-on-truncation note; commands.…

docs(round5): pipelines run() fail-loud-on-truncation note; commands.… #161

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
# Cancel superseded runs on the same ref so a new push doesn't queue behind stale CI.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
fmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all --check
clippy:
name: clippy (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
# Lint on every OS so each platform module is actually checked: cgroup /
# process-group (Linux), Job Object (Windows) and the macOS/BSD process
# group (macOS). Linting only on Linux would leave windows.rs and unix.rs
# unchecked.
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
# All three feature configurations must stay warning-clean: minimal
# (no features), default (process-control only — stats/limits opt-in), and
# everything.
- run: cargo clippy --all-targets --no-default-features -- -D warnings
- run: cargo clippy --all-targets -- -D warnings
- run: cargo clippy --all-targets --all-features -- -D warnings
hack:
name: feature-powerset
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: taiki-e/install-action@cargo-hack
# The clippy/test matrix exercises three FIXED feature configs
# (no-default / default / all). With 6 features, combinations the fixed set
# never builds — `limits` without `stats`, `record` alone —
# can break compilation undetected. `--feature-powerset --depth 2` checks
# every ≤2-feature combination, catching feature-gate mistakes
# the fixed configs miss. Platform-specific `sys/` gates stay covered by the
# 3-OS clippy matrix; this runs on Linux for the feature dimension only.
- run: cargo hack --feature-powerset --depth 2 check --all-targets
test:
name: test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
# macOS exercises the POSIX process-group containment path (unix.rs); the
# BSDs use the same path but have no hosted runner, so macOS stands in.
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
# `--all-features` so the feature-gated tests (stats, limits) still run now
# that `limits` is off by default.
- run: cargo build --all-targets --all-features
# `--include-ignored` runs the real-subprocess tests too, so kill-on-drop is
# actually exercised on each OS — including the macOS process-group teardown.
- run: cargo test --all-features -- --include-ignored
# Also exercise the default configuration (process-control only — stats and
# limits off) at runtime: it takes the `limits`-free `Job::new()` path — the
# one every default consumer runs — which `--all-features` alone never executes.
- run: cargo test -- --include-ignored
# And the bare core (no default features): clippy/doc only compile this
# configuration — running its tests guards the lean runtime path (and the
# cfg-gated arms in the suite) against bit-rot.
- run: cargo test --no-default-features -- --include-ignored
doc:
name: rustdoc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
# The crate's docs are intra-doc-link dense; a broken link degrades the
# docs.rs page silently (doctests don't catch it). Build both the
# docs.rs configuration (all features) and the minimal one.
- run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: -D warnings
- run: cargo doc --no-deps --no-default-features
env:
RUSTDOCFLAGS: -D warnings
# docs.rs builds on nightly with `--cfg docsrs` (activating
# `feature(doc_cfg)` for the per-item "Available on feature X" badges).
# The stable builds above leave that attribute inert, so they would NOT
# catch a docs.rs-only break (a renamed/removed nightly feature, a bad
# doc(cfg)). Build the docs.rs way too, so such a break fails here instead
# of silently degrading the published page.
- uses: dtolnay/rust-toolchain@nightly
- run: cargo +nightly doc --no-deps --all-features
env:
RUSTDOCFLAGS: --cfg docsrs -D warnings
audit:
name: cargo-deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
# Scan the dependency tree for security advisories, banned/duplicate
# crates, and licenses outside the permissive allow-list (deny.toml).
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check advisories bans licenses
msrv:
name: msrv (1.88)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
# Verify the crate still builds on its declared Minimum Supported Rust
# Version. Keep `toolchain` in sync with `rust-version` in Cargo.toml.
# (`@master` + the `toolchain` input accepts a two-component "1.88"; the
# version-branch refs require a full patch version like `@1.88.0`.)
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.88"
targets: x86_64-pc-windows-msvc, aarch64-apple-darwin
# rust-toolchain.toml tracks stable and would otherwise win here; remove it
# so cargo uses the 1.88 toolchain installed above and truly tests the floor.
- run: rm -f rust-toolchain.toml
- uses: Swatinem/rust-cache@v2
# `--all-features` so the feature-gated stats/limits code is held to the
# same MSRV floor as the default build.
- run: cargo check --all-targets --all-features
# Cross-`check` the other platform modules against the same floor: this
# Linux job alone never compiles windows.rs (Job Objects) or unix.rs
# (macOS/BSD pgroup), so a newer-than-MSRV API there would slip through.
# `check` doesn't link, so no foreign linkers are needed.
- run: cargo check --target x86_64-pc-windows-msvc --all-targets --all-features
- run: cargo check --target aarch64-apple-darwin --all-targets --all-features
public-api:
name: public-api diff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install cargo-public-api
run: cargo install cargo-public-api --locked
# Review aid, not a gate: show which public items changed vs the committed
# baseline so "did this PR move the surface?" becomes a reviewable diff.
# Pre-1.0 freedom means the surface CAN change freely; this makes it
# explicit and auditable while we still break. The step never fails CI —
# it only annotates the run with what moved.
- name: Diff public API vs baseline
continue-on-error: true
run: |
cargo public-api --simplified --all-features > /tmp/current-api.txt
echo "=== Changes to the public API surface vs public-api.txt ==="
diff public-api.txt /tmp/current-api.txt && echo "(no changes)"