ci: stop pull requests evicting the main cache seeds, and add an optional Warp cache store
Merged
TE
2mo ago+268+268+012345678901234567890123456789-97-97-01234567890123456789
Summary
Two changes, one macOS run.
1. Pull request jobs restore caches and never save them.
- On Warp runners
actions/cachewrites to the GitHub cache store, which evicts above about 10 GB.ci.ymlhad 14 save+restore steps in pull request jobs. Each run saved 1 to 3 GB entries scoped torefs/pull/N/merge, which no other pull request can read. - Measured 2026-09-20 05:55 UTC: 37.5 GB in 27 entries, oldest macOS entry 5 minutes old, only the Zig and Bun entries on
refs/heads/main. Compile admission loggedCache not foundfor the Debug compilation cachenightly.ymlseeds. Every compile ran cold: compile admission 18.3 min (compile 14.5), tests-build-and-lag 20.0 (build 12.9), release-build 29.9 (build 28.2). - All cache steps in
ci.ymlare now restore-only. Seeds come from the existing main-branch jobs innightly.yml.tests-build-and-lagandrelease-buildread thespm-keynightly.ymlsaves with the same path; their oldspm-build-andspm-release-families were written only by pull requests.release-builddrops the step that bounded the compilation cache before a save that no longer happens.
2. Optional Warp cache store, off by default.
- Two local composite actions,
.github/actions/cache-restoreand.github/actions/cache-save, each with two exactly complementary branches:actions/cache, orWarpBuilds/cachewhen the backend iswarpand the runner name starts withwarp-. Any other runner keeps using the GitHub store. - The compilation caches and Swift package caches go through them in
ci.yml(restore only), the twonightly.ymlseed jobs, and the nightly app build. - Backend = the
cache_backenddispatch input when set, else theCI_CACHE_BACKENDrepository variable. Unset means today's behaviour. - Rollout: set
CI_CACHE_BACKEND=warp. The store starts empty; the next17 */6seed fills it.
Cost (list prices, 2026-09-20)
- Warp store: $0.20 per GB-month, $0.0001 per operation, no size cap, entries expire 7 days after last use. Seeds only are about 10 to 20 GB: about $2 to $4 a month, plus about $7 a month of operations at 1,111 runs a week.
- For scale: 5.2 hours of pull request runs on 2026-09-20 cost about $960 at list price; the three build steps were $306 (32%).
Known gaps
- The two DerivedData restores have no main seeder, so they miss. They were 4.2 GB per pull request. Remove or seed them after a warm run is measured.
perf-activation.yml,ci-macos-compat.ymlandtest-e2e.ymlstill save to the GitHub store from their own runs.
Testing
- actionlint on both workflows.
- New
tests/test_ci_pull_request_caches_are_read_only.py(fails on main, first commit): no saving cache step inci.yml, everyspm-restore has anightly.ymlsave with the same key and path, and the two actions have complementary conditions, the expected upstream actions, and commit pins. Wired intoworkflow-guard-tests. tests/test_ci_change_areas.py,tests/test_ci_self_hosted_guard.sh,tests/test_nightly_universal_build.sh,tests/test_ci_test_compilation_cache_seed.shpass. Assertions that required pull request Release builds to save now require restore-only, and matchers accept the local actions.- Warp branch exercised with
nightly.ymlbuild_onlydispatches on this branch (cold, then warm). Results in a comment below.
Replaces https://github.com/manaflow-ai/cmux/pull/13158.
🤖 Generated with Claude Code
Summary by CodeRabbit
-
New Features
- Added configurable GitHub and Warp cache backends for manually triggered CI and nightly workflows.
- Added unified cache restore and save handling with cache-hit reporting.
- Improved cache reuse across Swift package and compilation caches.
-
Bug Fixes
- Pull request workflows now use read-only cache access, preventing accidental cache writes.
- Oversized compilation-cache handling is now performed during cache restoration.
- Tests-build-and-lag runs now perform full builds without DerivedData caching.