diff --git a/.github/workflows/js-tests.yml b/.github/workflows/js-tests.yml index 1e5bdfc773..9631cdd7fa 100644 --- a/.github/workflows/js-tests.yml +++ b/.github/workflows/js-tests.yml @@ -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