From ff0225dca5b1a4fc4b89a05267f12839d64d95a7 Mon Sep 17 00:00:00 2001 From: Anna Larch Date: Wed, 27 May 2026 10:01:32 +0200 Subject: [PATCH] perf(ci): cache npm dependencies in Cypress init job using buildjet cache The Cypress init job ran npm ci from scratch on every invocation. Add buildjet cache restore/save steps around npm ci, keyed on package-lock.json hash, so subsequent runs with unchanged dependencies skip the registry download entirely. Uses buildjet/cache (v4.0.2) to match the existing context caching already in this workflow. Signed-off-by: Anna Larch AI-Assisted-By: Claude Sonnet 4.6 Signed-off-by: Anna Larch --- .github/workflows/cypress.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index adb1cb5e73f..f3e85bdf15f 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -73,11 +73,23 @@ jobs: - name: Set up npm ${{ steps.versions.outputs.npmVersion }} run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + - name: Restore npm cache + uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2 + with: + path: ~/.npm + key: node-${{ steps.versions.outputs.nodeVersion }}-npm-${{ steps.versions.outputs.npmVersion }}-${{ hashFiles('**/package-lock.json') }} + - name: Install node dependencies & build app run: | npm ci TESTING=true npm run build --if-present + - name: Save npm cache + uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2 + with: + path: ~/.npm + key: node-${{ steps.versions.outputs.nodeVersion }}-npm-${{ steps.versions.outputs.npmVersion }}-${{ hashFiles('**/package-lock.json') }} + - name: Save context uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2 with: