Repository navigation
ci: refresh the Go cache every night and drop the pnpm store cache - #3275
Conversation
setup-go's cache keys on go.sum and a key keeps its first save, so main's Go cache stayed at its Nov 16 save and every pull request recompiled more each day main moved on: the server cross-compiles went from 17 s to 82 s (median) and pull requests from 4.45 to 6.0 minutes. Pull requests and merge groups now restore the newest entry the nightly saves under a key of its own each night, from a build that starts with empty caches. A cold pnpm install takes about 8 s on the arm runner, less than restoring the 1.2 GB store (14 s), and a miss added a 10 s save, so the pnpm store is no longer cached.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
There was a problem hiding this comment.
🟡 Changes recommended
A documentation nit remains in docs/design/build/turborepo.md where the described nightly cache behavior is ambiguous/self-contradictory and needs clarification to avoid confusion.
1 open issue
What changed in this PR
Updates CI caching to keep Go builds fast over time by restoring a fresh nightly Go cache for PR/merge-group runs, while removing pnpm store caching that is slower to restore than a cold install on the ARM runner.
Changes:
- Rework Go caching in
ci.ymlto restore the newest nightly cache for PR/merge-group runs and save only on scheduled nightly runs. - Drop pnpm store caching from
setup-nodeto reduce restore/save overhead and cache storage pressure. - Update Turborepo CI documentation to match the new caching behavior.
| File | Description |
|---|---|
| docs/design/build/turborepo.md | Updates Turborepo/CI documentation to describe the revised Go cache restore behavior and the decision to stop caching the pnpm store. |
| .github/workflows/ci.yml | Adjusts the CI workflow to disable setup-go’s built-in caching in favor of nightly-saved Go caches restored for PR/merge-group runs, and removes pnpm store caching. |
Review effort: Balanced
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

Summary
Two caching changes in
ci.yml, from a review of all 996full-prruns and 835 turbo run summaries since the turbo cutover (Nov 12–24).Go cache: a fresh entry every night. setup-go's cache keys on the
go.sumhash, and a key keeps its first save. So main's entry has not changed since Nov 16; the Nov 24 nightly loggedCache hit occurred on the primary key … not saving cache. As main moved on, every run recompiled more:build-binary)When
go.sumdoes change, pull requests restore nothing until the nightly saves the new key. Each one then saves its own ~1.5 GB entry. On Nov 13, 129 jobs compiled Go from empty caches.Now:
cache: false.ci-go-<os>-<arch>-<go version>-…entry through therestore-keysprefix.pnpm: no store cache. On the 32-core arm runner a cold
pnpm install --frozen-lockfilelogsdownloaded 2622 … Done in 7.6s. Restoring the 1.2 GB store takes 14 s, plus 8 s for the install, and a miss adds a 10 s save. That is about 10 s per job, and it frees the 68 store entries (78 GB of the repo's 107 GB Actions cache).Measured on one replayed pull request (below): the job took 410 s instead of 464 s. For the median pull request, the Nov 16–17 numbers suggest about 4.5 min instead of 6; that part is an estimate, not a measurement.
Measurement
Three runs of each side, started with
workflow_dispatchon two scratch branches (no pull request, no Vercel preview):ci-go-Linux-ARM64-1.26.9-45451147310-1(1.98 GB). Each measured run restored it.ci.yml. The measured runs compared--affectedwith it and read the remote cache without writing, so all six executed the same 175 of 181 tasks.@zitadel/server#buildbuild-binary)test:unit/test:postgres/test:sqliteinternal/service, which much of the server imports, so even with a fresh cache a cross-compile took 64 s. For the median pull request on Nov 16, it took 17 s.test:powfailed; the measured runs do not include that task) and after.Validation
if:conditions were checked. No workflow linter was run (none installed).go-version,GOCACHEandGOMODCACHEbefore and regardless of its own cache (src/main.ts,setGoEnvOutputs). The steps take the cache paths from those outputs.node scripts/check-pr-title.mjspasses.ci.ymlis a global dependency, so every task runs. Noci-go-entry exists yet, so Go compiles without a cache.Cache saved with key: ci-go-Linux-ARM64-1.26.9-45451147310-1, and each measured runCache restored from key:that key. To check after the merge:Cache saved with key: ci-go-Linux-ARM64-<version>-<run id>-1.Cache restored from key: ci-go-….Release notes / changeset
No changeset required — no shipped behavior changed.
Notes
artifacts.yml,scaffold-advisories.yml,spanner.ymlandrelease-publish.ymlstill use setup-go'sgo.sum-keyed cache and are untouched here.