fix(ci): build workspace per job instead of sharing dist via cache#193
Closed
merencia wants to merge 1 commit into
Closed
fix(ci): build workspace per job instead of sharing dist via cache#193merencia wants to merge 1 commit into
merencia wants to merge 1 commit into
Conversation
…cache Master CI went red after merging #189/#190/#191 (all individually green, docs/metadata-only changes). The build job passed, but lint/test/integration failed with missing build outputs (unresolved types; 'Cannot find module .../sidequest/dist/index.cjs'). Root cause: the setup action cached build outputs (**/dist) and the downstream jobs (which do not build) restored them via actions/cache. That cross-job cache handoff is unreliable: even after the build job saved the cache successfully, a downstream job starting seconds later got a cache miss (GitHub Actions cache read-after-write inconsistency, surfacing now that runners were force-migrated to Node 24). A miss left the job with no dist, so type-aware lint and the tests broke. Fix: stop sharing dist across jobs. Cache only dependencies, keyed on the lockfile (stable, high reuse), and have setup always run 'yarn build' so every job has a freshly built workspace. Builds are fast via Turbo. Also switches the deprecated --frozen-lockfile to --immutable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #192 (that PR object desynced from its branch head).
Problem
Master CI went red after merging #189/#190/#191 (all individually green, docs/metadata-only changes). The
buildjob passed, butlint/test/integration-testfailed with missing build outputs (unresolved types;Cannot find module .../sidequest/dist/index.cjs).Root cause
The
setupaction cached build outputs (**/dist) and the downstream jobs (which do not build) restored them viaactions/cache. That cross-job handoff is unreliable: thebuildjob saved the cache successfully, yet alintjob starting ~8s later gotCache not foundfor the same key (GitHub Actions cache read-after-write inconsistency, surfacing after runners were force-migrated to Node 24). A miss left the job with nodist.Fix
Stop sharing
distacross jobs: cache dependencies only (keyed on the lockfile), and havesetupalways runyarn buildso every job has a freshly built workspace (fast via Turbo). Also switches deprecated--frozen-lockfileto--immutable.Validation
This PR's CI exercises the change; merging produces a master commit whose CI uses the fix.