ci: skip cargo build/test/audit/deny on docs-only changes - #46
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
changesjob (dorny/paths-filter) that checks whether a push or PR touches anything undercrates/,Cargo.toml,Cargo.lock,deny.toml, or this workflow file.Security audit, andcargo-denystill always run, so their required status check names always report, but every substantive step inside them is gated behindif: needs.changes.outputs.rust == 'true'.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-levelif:keeps every job actually running and reporting a realsuccessconclusion, it just does nothing when there's nothing Rust-relevant to build.Test plan
.github/workflows/ci.yml, which is in therustfilter path list, so it exercises the full build path and proves the new workflow still runs correctly end to end.ROADMAP.mdtweak) should show all five checks completing in well under a minute.