ci: disable setup-node npm cache + add job timeouts#1035
Merged
Conversation
Workflows have been hanging indefinitely on `npm ci`, burning 6h of runner time before failing. Two changes: - Add timeout-minutes to every job (30 min for build/publish, 60 min for e2e and pin-to-pinata) so a stuck step fails fast and can be rerun. - Switch `npm ci` to `npm ci --prefer-offline --no-audit --no-fund` to prefer the actions/setup-node npm cache, skip the audit endpoint, and skip funding metadata. These flags only affect non-essential network calls — installation correctness is unchanged. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The actual hang root cause: actions/setup-node@v3's npm cache restore (cache: \"npm\") deadlocks on this monorepo — same issue tracked in actions/setup-node#516. The chromatic workflow and the e2e-tests job both already skip this cache and never hang. Remove cache: \"npm\" from every setup-node usage (lint-build-test, publish-alpha publish + publish_latest_release, pin-to-pinata). Also drop --prefer-offline since there's no GH-managed cache to prefer; keep --no-audit and --no-fund. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
v3 of these actions uses the deprecated Node 16 runtime, which may be contributing to the npm ci hangs. The chromatic workflow — which doesn't hang — already uses actions/checkout@v4. Bring the other hot-path workflows in line. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Hypothesis for the npm ci hangs: Node 24 ships npm 11, which interacts poorly with this monorepo's lockfile. Evidence: - The chromatic workflow doesn't use actions/setup-node, so it picks up the ubuntu-latest runner's default Node (currently 22). It never hangs. - All workflows that explicitly set node-version: \"24\" hang on npm ci. - The project's volta config already pins node 22.18.0 + npm 10.9.0, i.e. devs run on Node 22 locally — which matches \"works locally\". Bring the hot-path CI/publish/pin workflows back to Node 22 to match. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1035 +/- ##
=======================================
Coverage 91.73% 91.73%
=======================================
Files 182 182
Lines 7764 7766 +2
Branches 1514 1514
=======================================
+ Hits 7122 7124 +2
Misses 642 642
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Summary
Workflows have been hanging indefinitely on the step labeled `npm ci`. Root cause: `actions/setup-node@v3` with `cache: "npm"` deadlocks on this monorepo's lockfile (same symptom as actions/setup-node#516).
Evidence: the workflows that already skip the npm cache — chromatic, and the `e2e-tests` job in `ci.yaml` (which has `# cache: "npm"` commented out with a comment referencing this exact issue) — never hang. Only the workflows with `cache: "npm"` enabled get stuck.
Changes
Trade-off
Without the npm cache, `npm ci` will redownload tarballs from the registry on every run instead of pulling them from GHA cache. In practice this is fine — npm registry CDN is fast, and "slow" beats "hanging for 6 h".
Test plan
🤖 Generated with Claude Code