Skip to content

ci: skip cargo build/test/audit/deny on docs-only changes - #46

Merged
Etoile-Bleu merged 1 commit into
mainfrom
ci-skip-docs-only-changes
Jul 16, 2026
Merged

ci: skip cargo build/test/audit/deny on docs-only changes#46
Etoile-Bleu merged 1 commit into
mainfrom
ci-skip-docs-only-changes

Conversation

@Etoile-Bleu

Copy link
Copy Markdown
Owner

Summary

  • Adds a changes job (dorny/paths-filter) that checks whether a push or PR touches anything under crates/, Cargo.toml, Cargo.lock, deny.toml, or this workflow file.
  • The three CI matrix jobs, Security audit, and cargo-deny still always run, so their required status check names always report, but every substantive step inside them is gated behind if: needs.changes.outputs.rust == 'true'.
  • On a docs-only change (like the README/demo GIF PR that just ran the full 3-platform Rust build for zero reason), all five jobs still complete, just almost instantly instead of after several minutes of cargo build/test/clippy/fmt/audit/deny across Linux, Windows, and macOS.

Why step-level, not job-level if:

A job skipped via job-level if: can leave a required status check stuck in a pending state on some branch protection configurations, since a skipped job's conclusion isn't always treated as a pass. Step-level if: keeps every job actually running and reporting a real success conclusion, it just does nothing when there's nothing Rust-relevant to build.

Test plan

  • This PR itself touches .github/workflows/ci.yml, which is in the rust filter path list, so it exercises the full build path and proves the new workflow still runs correctly end to end.
  • A follow-up docs-only PR (e.g. a ROADMAP.md tweak) should show all five checks completing in well under a minute.

Adds a changes job using dorny/paths-filter to detect whether a push
or PR touches anything under crates/, Cargo.toml, Cargo.lock,
deny.toml, or this workflow file. The three CI matrix jobs, the
security audit, and cargo-deny still always run (so their required
status checks always report), but skip every substantive step when
nothing Rust-relevant changed, the way the README/demo GIF PR just
did across three platforms for no reason.

Job-level `if:` was deliberately avoided: a skipped job can leave a
required status check stuck pending on some branch protection setups.
Step-level `if:` keeps the job itself always completing with a real
success conclusion, just almost instantly when there is nothing to
build.
@Etoile-Bleu
Etoile-Bleu merged commit 9ec0c4c into main Jul 16, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant