From de0abc0617794a8c4ae661d2f67f4b23d4ab51fe Mon Sep 17 00:00:00 2001 From: kshitij <82637225+kshitijk4poor@users.noreply.github.com> Date: Fri, 14 Aug 2026 14:47:47 +0530 Subject: [PATCH] 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. --- .github/workflows/js-tests.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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