Skip to content

ci: stop setup-node saving a pnpm store the job never created - #1104

Merged
yasin-ce merged 1 commit into
mainfrom
yasince/ci/pnpm-store-cache-save
Jul 31, 2026
Merged

ci: stop setup-node saving a pnpm store the job never created#1104
yasin-ce merged 1 commit into
mainfrom
yasince/ci/pnpm-store-cache-save

Conversation

@yasin-ce

Copy link
Copy Markdown
Collaborator

Description

Removes cache: "pnpm" from every setup-node below setup, so a job can no longer fail while saving a pnpm store it never created.

setup-node's post-step saves the pnpm store. Jobs below setup restore node_modules from the cache setup saved, so test -d node_modules || pnpm install skips the install — and the store is only ever created by pnpm install. When setup-node's own store cache also missed, the post-step tried to save a path that does not exist and failed the job with:

##[error]Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.

That happens in Post Setup Node, i.e. after the job's real work has already passed — the test shards reported failure on runs where all 4155 tests passed. It hit #1081, #1093 and #1096; it spared other PRs only because their store cache happened to hit.

The audit job already fixed this the same way and documented it. This applies that precedent to the remaining five jobs and promotes the explanation to the rule it always was, so the next job added below setup doesn't reintroduce it.

setup keeps cache: "pnpm" — it installs unconditionally, so its store exists and is worth caching run-over-run.

Related Issues

Checklist

  • Have you tested your changes locally?
  • Have you reviewed the code for any potential issues?
  • Have you documented any necessary changes in the project's documentation?
  • Have you added any necessary tests for your changes?
  • Have you updated any relevant dependencies?

Additional Notes

On the unticked boxes. A workflow change can't be exercised locally, and pull_request runs use the workflow from the PR branch — so this PR's own checks are the first real test, and the fix only protects other PRs once it is on main. What I could verify locally: the YAML parses, and a structural pass over every job confirms none now pairs cache: "pnpm" with a skipped install. lint, format --check, lint:copyright and lint:i18n pass. No source or test files are touched, so there is nothing to add a test for.

Why remove the cache rather than create the directory. The first version of this added mkdir -p "$(pnpm store path)" so the save would find an empty directory. That also works and keeps the store warm for the rare path where a downstream job misses the node_modules cache and does install. I dropped it because these jobs never read the store — every step runs against already-installed node_modules (pnpm run …, pnpm --filter … exec …), so restoring it was download-and-extract work that nothing consumed, and adding a second remedy for something this file already solves one way is worse than applying the existing one.

The one store consumer. expo:prebuild ends in pnpm dlx pod-install ios, and pnpm dlx does resolve from the registry — one small package now fetched cold on the build job instead of hardlinked.

Residual risk. A downstream job that misses the node_modules cache will pnpm install without a warm store, which is slower. All five are needs: setup (directly or via build) and setup saves that cache under the lockfile-hashed key in the same run before they start, so a miss needs eviction or a failed save in the minutes between. It costs one slower job, not a failed one.

@yasin-ce
yasin-ce marked this pull request as ready for review July 30, 2026 19:00
@yasin-ce
yasin-ce requested a review from a team as a code owner July 30, 2026 19:00
@yasin-ce
yasin-ce merged commit add5981 into main Jul 31, 2026
15 checks passed
@yasin-ce
yasin-ce deleted the yasince/ci/pnpm-store-cache-save branch July 31, 2026 06:29
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.

2 participants