ci: cache npm downloads in frontend-heavy workflows#40744
Conversation
|
Bito Automatic Review Skipped - Files Excluded |
|
|
The pre-commit, E2E (Cypress + Playwright), and experimental-Playwright jobs run `npm ci` for the frontend with no download cache — `actions/setup-node` was configured without `cache:`, and the cached-dependencies npm cache is disabled. Every one of those jobs re-downloads the full package set from the registry, and npm install is a large part of the per-job setup time that dominates these workflows. Enable setup-node's built-in npm cache (the lightweight option: it caches the ~/.npm download cache, not node_modules, keyed on the frontend package-lock.json). `npm ci` still does a clean install but skips re-fetching unchanged tarballs. This avoids the heavier full-node_modules caching that can evict the more valuable instrumented-assets cache under the repo's 10 GB cache budget. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1f795d8 to
a9ac54e
Compare
|
Bito Automatic Review Skipped – PR Already Merged |
SUMMARY
The
pre-commit, E2E (Cypress + Playwright), and experimental-Playwright jobsrun
npm cifor the frontend with no download cache —actions/setup-nodewas configured without
cache:, and thecached-dependenciesnpm cache isdisabled (
# cache-restore npmis commented out inbashlib.sh). So every oneof those jobs re-downloads the full package set from the registry, and npm
install is a large chunk of the per-job setup time that dominates these
workflows.
This enables
setup-node's built-in npm cache — the lightweight option:It caches the
~/.npmdownload cache (notnode_modules), keyed on thefrontend lockfile.
npm cistill does a clean install but skips re-fetchingunchanged tarballs. Deliberately avoiding full-
node_modulescaching, which islarge and could evict the more valuable instrumented-assets cache under the
repo's 10 GB cache budget.
TESTING INSTRUCTIONS
CI-only. First run on each workflow primes the cache; subsequent runs should
show a cache hit on the "Setup Node.js" step and a faster
npm ci.ADDITIONAL INFORMATION
🤖 Generated with Claude Code