From ad8b43c36c19e34e7e87538d92dd2f85b00da58c Mon Sep 17 00:00:00 2001 From: Sirius DevOps Date: Sat, 12 Sep 2026 01:39:41 -0400 Subject: [PATCH] ci: skip cargo suite when the change cannot affect Rust 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. --- .forgejo/workflows/ci.yml | 19 +++++++++++++++++++ README.md | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index e4690a9..4c7b8aa 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -2,10 +2,29 @@ name: ci # Tests and clippy run on the Pi runner (aarch64) inside a rust container, so # this CI proves the aarch64 build too. Jobs use the runner's `docker` label. +# +# Path allowlist: skip the cargo job when the change cannot affect the Rust +# build (docs, android, scripts, sibling workflows, markdown). No required +# status checks on main, so a missing run is not a merge trap. +# workflow_dispatch has no path filter — it always runs the suite. on: push: branches: [main] + paths: + - "src/**" + - "crates/**" + - "tests/**" + - "Cargo.toml" + - "Cargo.lock" + - ".forgejo/workflows/ci.yml" pull_request: + paths: + - "src/**" + - "crates/**" + - "tests/**" + - "Cargo.toml" + - "Cargo.lock" + - ".forgejo/workflows/ci.yml" workflow_dispatch: # One cargo job on the Pi at a time. Overlapping PR+main runs shared the diff --git a/README.md b/README.md index 562ec3e..fa13334 100644 --- a/README.md +++ b/README.md @@ -281,7 +281,7 @@ FORGEJO_TOKEN= scripts/build-release-local.sh vX.Y.Z Workflows (Forgejo Actions, `.forgejo/workflows/`): -- [`.forgejo/workflows/ci.yml`](.forgejo/workflows/ci.yml) — `cargo test --locked` + `cargo clippy --all-targets -- -D warnings` on `main` and PRs (ignored Tor-live tests are not run). Pi runner, `docker` label. +- [`.forgejo/workflows/ci.yml`](.forgejo/workflows/ci.yml) — `cargo test --locked` + `cargo clippy --all-targets -- -D warnings` on `main` and PRs when `src/`, `crates/`, `tests/`, `Cargo.toml`, `Cargo.lock`, or this workflow change (ignored Tor-live tests are not run). `workflow_dispatch` always runs the suite. Pi runner, `docker` label. - [`.forgejo/workflows/release.yml`](.forgejo/workflows/release.yml) — on core paths to `main`: next tag, aarch64 (`docker`) + x86_64 (`docker-amd64`), one release. `workflow_dispatch` rebuilds a tag or `dry_run`s. Concurrency group `onionwire-release` (separate from CI). Scripts: