Skip to content

ci: run on pushes to integration so PRs restore a warm rust-cache (SNB-625) - #27

Merged
setavenger merged 1 commit into
integrationfrom
snb-625-ci-integration-cache
Oct 1, 2026
Merged

setavenger merged 1 commit into
integrationfrom
snb-625-ci-integration-cache

Conversation

@setavenger

@setavenger setavenger commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

SNB-625

Problem

Every PR run logs No cache found. from Swatinem/rust-cache and compiles the whole workspace cold, which takes about 2–3 minutes per run.

  • PRs target integration, but ci.yml only runs on pushes to master.
  • GitHub lets a PR run restore caches only from its own ref, its base branch, or the default branch.
  • So no cache ever exists on integration, and each PR's own refs/pull/N/merge cache is invisible to every other PR.

Change

on.push.branches now includes integration (.github/workflows/ci.yml). Each merge into integration runs CI once and saves one cache, and every PR into integration restores it. The extra run per merge is off the PR critical path, and it also tests the merged state.

Verification

I didn't push to integration. Instead, a throwaway branch snb-625-demo-base stood in for it: this PR's head plus one commit adding that branch to on.push.branches. Its push-triggered run saved a cache. Then a draft PR into that branch (#30, an empty commit) checked that a PR restores its base branch's cache.

Run Event rust-cache test compile clippy compile Cache save Job
36872856012 (this PR, base integration) pull_request No cache found. 2m02s 1m08s 42 s 7m41s
36872857180 (snb-625-demo-base, stands in for an integration merge) push No cache found., then saved v0-rust-test-Linux-x64-c7b3ef7d-b8922df3 on refs/heads/snb-625-demo-base 2m42s 1m30s 20 s 8m31s
36874087311 (#30, base snb-625-demo-base) pull_request Restored from cache key "v0-rust-test-Linux-x64-c7b3ef7d-b8922df3" full match: true. 14.5 s 2.4 s 0 s (Cache up-to-date.) 4m14s

Limits

  • A PR that changes Cargo.lock misses the exact key. rust-cache then falls back to the v0-rust-test-Linux-x64-c7b3ef7d prefix and restores most dependencies.
  • A new stable rustc changes the first hash, so PRs run cold until the next merge into integration. Pinning the toolchain would avoid that; it is not done here.
  • PR runs still save their own refs/pull/N/merge caches (about 1.2 GB each, against a 10 GB limit). The integration cache is read by every PR, so it is the least likely to be evicted. If eviction shows up, save-if: ${{ github.event_name == 'push' }} would stop PR runs from saving.

Every PR run logged `No cache found.` and compiled the workspace cold
(about 2-3 minutes). PRs target `integration`, but CI only ran on pushes to
`master`, and a PR run can only restore caches saved on its own ref, its
base branch or the default branch. No cache ever existed on `integration`,
and per-PR caches are invisible to other PRs.

Also run on pushes to `integration`. Each merge then saves one cache that
every PR into `integration` restores. The extra run per merge is off the PR
critical path, and it also tests the merged state.

SNB-625

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@setavenger
setavenger merged commit fe88a2d into integration Oct 1, 2026
1 check passed
@setavenger
setavenger deleted the snb-625-ci-integration-cache branch October 1, 2026 20:48
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