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 <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
This commit is contained in:
Anna Larch 2026-05-27 10:01:32 +02:00
parent c8b29c9dac
commit ff0225dca5

View file

@ -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: