ci(js-tests): drop dead electron download-cache path, skip redundant npm upgrade
Review findings on the caching commit: - ~/.cache/electron was dead weight: with npm ci skipped on an exact cache hit, the download cache is never read (electron's unpacked binary lives in node_modules/electron/dist, inside the cached tree); it only inflated every saved archive by ~110MB. - 'npm i -g npm@12' ran unconditionally in all 14 matrix jobs (~5-15s each); now a no-op when the bundled npm is already 12.x, which also keeps the installed major aligned with the npm12 cache-key tag. yaml + actionlint pass.
This commit is contained in:
@@ -20,7 +20,9 @@ jobs:
|
||||
|
||||
- name: grab npm 12
|
||||
run: |
|
||||
npm i -g npm@12
|
||||
# No-op once the bundled npm is already 12.x — saves ~5-15s/job and
|
||||
# keeps the installed major aligned with the npm12 cache-key tag.
|
||||
npm --version | grep -q '^12\.' || npm i -g npm@12
|
||||
|
||||
# ``setup-node``'s ``cache: npm`` only caches the ~/.npm tarball cache;
|
||||
# every job still re-extracts the full workspace node_modules and reruns
|
||||
@@ -93,12 +95,16 @@ jobs:
|
||||
|
||||
- name: grab npm 12
|
||||
run: |
|
||||
npm i -g npm@12
|
||||
# No-op once the bundled npm is already 12.x — saves ~5-15s/job and
|
||||
# keeps the installed major aligned with the npm12 cache-key tag.
|
||||
npm --version | grep -q '^12\.' || npm i -g npm@12
|
||||
|
||||
# Same rationale as the discovery job's cache above, but this ``npm ci``
|
||||
# runs WITH install scripts, so the tree includes postinstall artifacts
|
||||
# and the Electron binary is fetched to ~/.cache/electron — cache both
|
||||
# under a key distinct from the -noscripts one.
|
||||
# (electron's postinstall unpacks its binary into node_modules/electron/
|
||||
# dist, which lives inside the cached tree — the ~/.cache/electron
|
||||
# download cache is deliberately NOT cached: with npm ci skipped on hit
|
||||
# it would never be read, only inflate the archive).
|
||||
- name: Restore node_modules
|
||||
id: node-modules-cache
|
||||
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
|
||||
@@ -110,7 +116,6 @@ jobs:
|
||||
ui-tui/packages/*/node_modules
|
||||
tests-js/node_modules
|
||||
web/node_modules
|
||||
~/.cache/electron
|
||||
key: node-modules-scripts-${{ runner.os }}-node26-npm12-${{ hashFiles('package-lock.json') }}
|
||||
|
||||
- uses: ./.github/actions/retry
|
||||
|
||||
Reference in New Issue
Block a user