Skip to content

CI: run only the jobs a commit needs - #45

Merged
Amet13 merged 2 commits into
mainfrom
claude/relaxed-ramanujan-4sc5w7
Dec 2, 2026
Merged

Amet13 merged 2 commits into
mainfrom
claude/relaxed-ramanujan-4sc5w7

Conversation

@Amet13

@Amet13 Amet13 commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

Makes CI run only what a commit needs. Before this, every commit ran the full Rust workflow, including docs-only ones such as "Remove CI and badge links from README".

Where the time went (main's last full run)

Job Time Main cost
fixtures 5m54s apt-get install TeX Live + pandoc: 4m43s
fuzz 4m42s nightly build with no cache, then the deterministic runs
test (windows) 2m43s
perf 1m35s
test (macos) 1m28s sometimes cancelled when no macOS runner is free

Changes (.github/workflows/rust.yml)

  • New changes job runs .github/scripts/ci-changes.sh, a plain git diff with no third-party action, and every other job is gated on its output:
    • documentation alone (*.md, docs/, etc.) → no build or test jobs;
    • Rust code → lint, test ×3, msrv, wasm, perf;
    • parser crates (synctex, tex, pdf, model) or fuzz/ → plus deterministic fuzz;
    • Cargo manifests / lock / deny.toml → plus cargo deny;
    • fixtures/ or xtask/ → plus the TeX Live fixture rebuild;
    • integrations/vscode/ alone → only the VS Code job (so the weekly Dependabot npm bump no longer builds Rust).
  • Fail-safe: an unknown base, a manual run, the weekly run, or a change to the workflow or the script runs everything.
  • Weekly full run (Monday): catches TeX Live drift in the fixtures and new cargo deny advisories, which no longer run on every commit.
  • Caches:
    • Rust caches are saved only from main (save-if), so pull requests restore a warm cache instead of each writing its own;
    • the fuzz build is now cached.
  • macOS off pull requests. In the last 40 runs, every macOS failure was a job that waited 15 minutes for a runner ("not acquired by Runner … capacity constraints for macOS arm64") and was then cancelled, and one "success" waited the same 15 minutes. So pull requests now test on Linux and Windows, and macOS runs after merge on main, weekly and on manual runs. A macOS regression is still caught, just after merging. Release builds still use macOS runners, because Mac users need the binaries.
  • Concurrency: a newer commit cancels the older run on main too, not only on pull requests.

There is no branch protection on main, so skipped jobs do not block merging. If required checks are added later, GitHub counts skipped jobs as passing.

Checks

  • .github/tests/test_ci_changes.py (run by the lint job) covers the selection: docs only, Rust code, parser crates, Cargo.lock, fixtures, VS Code only, workflow change, and unknown base. 12 tests pass together with the Dependabot test.
  • I also ran the script on real history:
    • b61c17a (README) → nothing;
    • 54f60d2 (Dependabot @types/node) → vscode only;
    • dac47a7 (locator merge) → everything Rust.
  • This PR changes the workflow itself, so its own CI runs everything, which doubles as a full check of the new setup.
  • docs/releasing.md has a "Continuous integration" section, and the CHANGELOG is updated.

https://claude.ai/code/session_01Xj9ekYmyESdZUsW8uWkzgv


Generated by Claude Code

A changes job (.github/scripts/ci-changes.sh, plain git diff) gates every
job in rust.yml: documentation alone runs none of them; the TeX Live
fixture rebuild (about 6 minutes, mostly apt) runs when fixtures or xtask
change and weekly; deterministic fuzzing when the parser crates change,
now with a build cache. Rust caches are saved only from main so PRs start
warm; newer commits cancel older runs on main too. A weekly full run
catches TeX Live drift and new cargo-deny advisories. Tested by
.github/tests/test_ci_changes.py; documented in docs/releasing.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xj9ekYmyESdZUsW8uWkzgv
Every macOS failure in the last 40 runs was a job that waited 15 minutes
for a runner and was cancelled (GitHub capacity for macOS arm64). Pull
requests test on Linux and Windows; macOS runs on main, weekly and on
manual runs. Release builds still use macOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xj9ekYmyESdZUsW8uWkzgv
@Amet13
Amet13 marked this pull request as ready for review December 2, 2026 00:16
@Amet13
Amet13 merged commit 159951a into main Dec 2, 2026
17 checks passed
@Amet13
Amet13 deleted the claude/relaxed-ramanujan-4sc5w7 branch December 2, 2026 00: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.

2 participants