ci: per-job pnpm install dir to fix the host-runner setup-pnpm race #23
Reference in New Issue
Block a user
Delete Branch "feature/ci-pnpm-setup-isolation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The post-merge
ui-testrun for #22 failed at the Set up pnpm step (beforeany test ran) with:
pnpm/action-setup@v4installs pnpm into the shared default~/setup-pnpm. Onthe single host-mode runner
$HOMEis shared across concurrent jobs, so when apost-merge
dev-deploy(deploy) andui-test(test) — which live in differentconcurrency groups — overlap, their self-installers race on that directory and
one dies with
ENOTEMPTY. (The identical commit passedui-testtwice when itdid not overlap a deploy.)
Fix
Point each pnpm step's
destat${{ runner.temp }}/setup-pnpm, a per-jobisolated directory, so concurrent jobs never share the install location.
desttoPATH, soactions/setup-node(cache: pnpm) andlater
pnpmcalls are unaffected.failure was the action's own self-install dir, not the store.
Applied to the three workflows that set up pnpm:
ui-test.yaml,dev-deploy.yaml,prod-build.yaml. No serialization / concurrency-groupchange, so it cannot cancel an auto-deploy.
🤖 Generated with Claude Code
`pnpm/action-setup@v4` defaults to installing pnpm in the shared `~/setup-pnpm`. On the single host-mode runner $HOME is shared across concurrent jobs, so when two pnpm jobs overlap (e.g. a post-merge `dev-deploy` and `ui-test`, which sit in different concurrency groups) their self-installers race and one fails with `ENOTEMPTY ... rmdir '~/setup-pnpm/node_modules/.bin/store/v11/files'` before the tests even run. Point each step's `dest` at `${{ runner.temp }}/setup-pnpm` (a per-job isolated directory) so concurrent jobs never share the install location. The action still adds `dest` to PATH, so setup-node's pnpm cache and later `pnpm` calls are unaffected; the pnpm package store stays shared (safe — pnpm locks it). Applied to the three workflows that set up pnpm: ui-test, dev-deploy, prod-build. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>