ci: skip cargo suite when the change cannot affect Rust #32

Merged
sirius merged 1 commit from wt/t_bc2f5c51 into main 2026-09-12 05:44:13 +00:00
Owner

Summary

Stop running the full cargo test + clippy job when the change cannot affect the Rust build.

Mechanism: paths allowlist on both push (main) and pull_request. GET /api/v1/repos/sirius/onionwire/branch_protections returned [] — no required status checks — so a docs-only PR that produces no test check is not a merge trap. Did not add an in-workflow changed-files gate (would only matter if Lance later requires the test check).

Allowlist (what cargo test/clippy at repo root actually read; no rust-toolchain.toml, .cargo/config.toml, or build.rs in tree; tests do not include_str scripts/):

  • src/**, crates/**, tests/**, Cargo.toml, Cargo.lock, .forgejo/workflows/ci.yml

Not in the allowlist: docs/**, *.md, android/**, scripts/**, .forgejo/workflows/release.yml, .forgejo/workflows/android-release.yml, LICENSE.

workflow_dispatch: kept, no path filter — always runs the full suite.

Main-push duplication: kept on purpose (same allowlist). Trunk verification after merge; not dropped.

Suite when it runs: unchanged cargo test --locked and cargo clippy --locked --all-targets -- -D warnings. Concurrency group onionwire-ci-pi with cancel-in-progress: false unchanged.

Measured savings (last 20 ci.yml runs)

13 of 20 would not have started under this filter (45.3 min serialized Pi wall-clock; mean skipped run ~209s). 7 of 20 still would run (they touched src/ or tests/).

Concrete skips:

  • PR #28 (only .forgejo/workflows/release.yml) — run 103 235s success, run 105 172s failure. The merge commit 3e28fa3 also bought a release build (run 107); that workflow is a different card.
  • Android-only merge 4a248f5 (PR #26: android/**, scripts/build-android-local.sh, android-release.yml) — run 101 188s.

Would still run (not a skip): docs merge PR #23 / 53f9914 also touched tests/tui_frames.rs.

Local proof

  • git diff --stat vs main: .forgejo/workflows/ci.yml, README.md (CI bullet only)
  • cargo test --locked: 181 passed, 3 ignored
  • cargo clippy --locked --all-targets -- -D warnings: clean
## Summary Stop running the full `cargo test` + clippy job when the change cannot affect the Rust build. **Mechanism:** `paths` allowlist on both `push` (main) and `pull_request`. `GET /api/v1/repos/sirius/onionwire/branch_protections` returned `[]` — no required status checks — so a docs-only PR that produces no `test` check is not a merge trap. Did **not** add an in-workflow changed-files gate (would only matter if Lance later requires the `test` check). **Allowlist** (what `cargo test`/`clippy` at repo root actually read; no `rust-toolchain.toml`, `.cargo/config.toml`, or `build.rs` in tree; tests do not `include_str` `scripts/`): - `src/**`, `crates/**`, `tests/**`, `Cargo.toml`, `Cargo.lock`, `.forgejo/workflows/ci.yml` **Not in the allowlist:** `docs/**`, `*.md`, `android/**`, `scripts/**`, `.forgejo/workflows/release.yml`, `.forgejo/workflows/android-release.yml`, `LICENSE`. **`workflow_dispatch`:** kept, no path filter — always runs the full suite. **Main-push duplication:** kept on purpose (same allowlist). Trunk verification after merge; not dropped. **Suite when it runs:** unchanged `cargo test --locked` and `cargo clippy --locked --all-targets -- -D warnings`. Concurrency group `onionwire-ci-pi` with `cancel-in-progress: false` unchanged. ## Measured savings (last 20 `ci.yml` runs) 13 of 20 would **not** have started under this filter (**45.3 min** serialized Pi wall-clock; mean skipped run ~209s). 7 of 20 still would run (they touched `src/` or `tests/`). Concrete skips: - PR **#28** (only `.forgejo/workflows/release.yml`) — [run 103](https://forgejo.siriusdevops.com/sirius/onionwire/actions/runs/103) 235s success, [run 105](https://forgejo.siriusdevops.com/sirius/onionwire/actions/runs/105) 172s failure. The merge commit `3e28fa3` also bought a **release** build ([run 107](https://forgejo.siriusdevops.com/sirius/onionwire/actions/runs/107)); that workflow is a different card. - Android-only merge `4a248f5` (PR #26: `android/**`, `scripts/build-android-local.sh`, `android-release.yml`) — [run 101](https://forgejo.siriusdevops.com/sirius/onionwire/actions/runs/101) 188s. Would **still run** (not a skip): docs merge PR #23 / `53f9914` also touched `tests/tui_frames.rs`. ## Local proof - `git diff --stat` vs main: `.forgejo/workflows/ci.yml`, `README.md` (CI bullet only) - `cargo test --locked`: 181 passed, 3 ignored - `cargo clippy --locked --all-targets -- -D warnings`: clean
ci: skip cargo suite when the change cannot affect Rust
Some checks failed
ci / test (pull_request) Failing after 4m5s
ad8b43c36c
Path allowlist on push-to-main and pull_request: src/, crates/, tests/,
Cargo.toml, Cargo.lock, and this workflow. workflow_dispatch still always
runs. No branch protections, so a skipped run is not a merge trap.
sirius force-pushed wt/t_bc2f5c51 from ad8b43c36c
Some checks failed
ci / test (pull_request) Failing after 4m5s
to 1218869629
Some checks failed
ci / test (pull_request) Has been cancelled
2026-09-12 05:40:13 +00:00
Compare
sirius merged commit fecec6c29a into main 2026-09-12 05:44:13 +00:00
Author
Owner

Live proof after merge:

  • docs-only PR #35 (docs/TUI.md whitespace): no ci.yml run (commit statuses empty).
  • src/ probe PR #36: run 126 success.
  • workflow_dispatch on main: run 124 success.
  • Branch protections: GET .../branch_protections → [].
Live proof after merge: - docs-only PR #35 (`docs/TUI.md` whitespace): **no** `ci.yml` run (commit statuses empty). - `src/` probe PR #36: [run 126](https://forgejo.siriusdevops.com/sirius/onionwire/actions/runs/126) success. - `workflow_dispatch` on main: [run 124](https://forgejo.siriusdevops.com/sirius/onionwire/actions/runs/124) success. - Branch protections: `GET .../branch_protections` → `[]`.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/onionwire!32
No description provided.