ci: path-gate jobs, cache builds, cancel superseded runs#136
Merged
Conversation
The CI ran clippy + a 2-OS test matrix + a RustSec audit on every PR with no path filtering, no build cache, and no concurrency cancellation — so a markdown-only PR paid for the full Rust pipeline and every run cold-compiled. - ci.yml: gate the `pull_request` trigger on paths that can affect clippy/tests/dogfood. The dogfood step reads hubs/AGENTS.md/surf.toml, so those are included; docs/npm/scripts-only PRs now run zero Rust jobs. Pushes to main stay unfiltered for pre-release safety. - Add Swatinem/rust-cache to `check` and `test` (SHA-pinned, v2.9.1) — the builds were cold every run. - Add concurrency so a new commit cancels its superseded PR run; main runs are never cancelled mid-flight. - Move the RustSec audit into its own audit.yml, gated on Cargo.lock/Cargo.toml changes plus a weekly cron. Advisories land independently of our commits, so the cron still catches a CVE on an unchanged, pinned dependency. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Why
CI ran clippy + a 2-OS test matrix + a RustSec audit on every PR — no path filtering, no build cache, no concurrency cancellation. A markdown-only PR paid for the full Rust pipeline, the audit ran even when no dependency changed, and every run cold-compiled.
What changed
ci.ymlpull_requesttrigger so docs/npm/scripts-only PRs run zero Rust jobs. The dogfood step (surf lint/check) readshubs/**,AGENTS.md, andsurf.toml, so those are included in the trigger — a hub edit still runs tests. Pushes tomainstay unfiltered (pre-release safety).Swatinem/rust-cacheadded tocheckandtest(SHA-pinned, v2.9.1) — builds were cold every run.concurrencyso a new commit cancels its superseded PR run;mainruns are never cancelled mid-flight (cancel-in-progressis gated topull_request).audit.yml(new) — RustSec scan moved out ofci.yml, gated onCargo.lock/Cargo.tomlchanges plus a weekly cron. Advisories are disclosed independently of our commits, so the cron still catches a CVE on an unchanged, pinned dependency. Onschedule,rustsec/audit-checkopens an issue rather than failing a PR — the desired outcome for drift.Reuses the existing pinned
checkout/audit-checkSHAs; dependabot'sgithub-actionsecosystem already tracks these for bumps.Net effect
*.rs/Cargo.*hubs/**,AGENTS.md,surf.tomldocs/**,npm/**,scripts/**onlyHeads-up / behaviour change
A docs-only PR now shows no Rust CI checks at all — not failures, simply none triggered. Safe here since
mainhas no branch protection, but worth knowing: for a docs-only PR there's nothing to "wait for green" on, and that's expected.Verification
.github/workflows/ci.yml(in thepathsinclude) but noCargo.*, so it's the live test: CI should run (check+test); Audit should not.check/testrun reports a rust-cache hit.🤖 Generated with Claude Code