CI: what a run spends, and what a cache can save

The owner’s question (2026-10-24): a CI run takes about 30 minutes; as the compiler becomes modular (one Rust unit per .nika, #667 step 4, modular-compiler.md), can CI rebuild only what changed? Companion to long-jobs.md. Durations below are GitHub’s step timestamps, given as shares; #795 holds the runs.

Parked by the owner (2026-10-24): the plan below is not enough; the build has to become more cacheable first (modular units, #667 step 4, #793).

Where a run goes (three develop runs, 2026-10-24)

The caches there are, and whether they are sound

What keeps a cache from turning red into green

promote moves main on a green run, so a stale artefact taken for fresh is the one failure that matters.

  1. Restore only what is checked by content or by Cargo’s fingerprints: the dependencies cache, rustc’s incremental store, the compiled-std tree.
  2. Never restore source mtimes (git restore-mtime and the like): with them Cargo would take a crate built from an older tree as fresh whenever the changing commit is older than the cache. Nightly’s content-hash freshness (-Z checksum-freshness) is not ours (ADR-001 D1, stable only).
  3. Keys name the lock file, rust-toolchain.toml, OS, arch and profile.
  4. Only develop pushes save; pull requests and schedule runs read.
  5. One clean build per push stays: if x86 builds incrementally, arm64 stays a plain release build of the same commit, and the weekly run uses no build cache at all.

Order

Now, independent of the module split: separate building the tests from running them (to see the shares), nextest’s pool, the dependencies-only cache, then shards if the test run still dominates. After #667 step 4: the incremental x86 build, judged by units re-optimised per commit. Not a cache but the largest single share: running develop runs side by side instead of queueing them (owner’s choice; promote already moves main only forward). Build order and tests: #795.

This site is open source. Improve this page.