Skip to content

ci: path-gate jobs, cache builds, cancel superseded runs#136

Merged
Connorrmcd6 merged 1 commit into
mainfrom
ci/optimize-path-gating
Jun 18, 2026
Merged

ci: path-gate jobs, cache builds, cancel superseded runs#136
Connorrmcd6 merged 1 commit into
mainfrom
ci/optimize-path-gating

Conversation

@Connorrmcd6

Copy link
Copy Markdown
Owner

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.yml

  • Path-gate the pull_request trigger so docs/npm/scripts-only PRs run zero Rust jobs. The dogfood step (surf lint/check) reads hubs/**, AGENTS.md, and surf.toml, so those are included in the trigger — a hub edit still runs tests. Pushes to main stay unfiltered (pre-release safety).
  • Swatinem/rust-cache added to check and test (SHA-pinned, v2.9.1) — builds were cold every run.
  • concurrency so a new commit cancels its superseded PR run; main runs are never cancelled mid-flight (cancel-in-progress is gated to pull_request).

audit.yml (new) — RustSec scan moved out of ci.yml, gated on Cargo.lock/Cargo.toml changes plus a weekly cron. Advisories are disclosed independently of our commits, so the cron still catches a CVE on an unchanged, pinned dependency. On schedule, rustsec/audit-check opens an issue rather than failing a PR — the desired outcome for drift.

Reuses the existing pinned checkout / audit-check SHAs; dependabot's github-actions ecosystem already tracks these for bumps.

Net effect

PR touches check test audit
*.rs / Cargo.*
hubs/**, AGENTS.md, surf.toml
docs/**, npm/**, scripts/** only
weekly cron

Heads-up / behaviour change

A docs-only PR now shows no Rust CI checks at all — not failures, simply none triggered. Safe here since main has no branch protection, but worth knowing: for a docs-only PR there's nothing to "wait for green" on, and that's expected.

Verification

  • Workflow YAML parses cleanly.
  • This PR touches .github/workflows/ci.yml (in the paths include) but no Cargo.*, so it's the live test: CI should run (check + test); Audit should not.
  • Post-merge spot-checks: a docs-only PR triggers nothing; a dependabot Cargo bump triggers Audit; a second push to a PR cancels the prior run; second check/test run reports a rust-cache hit.

🤖 Generated with Claude Code

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>
@Connorrmcd6 Connorrmcd6 merged commit 0129ea1 into main Jun 18, 2026
4 checks passed
@Connorrmcd6 Connorrmcd6 deleted the ci/optimize-path-gating branch June 18, 2026 06:16
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