Skip to content

Commit f29152c

Browse files
committed
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>
1 parent 252dedf commit f29152c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

.github/workflows/cypress.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,23 @@ jobs:
7373
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
7474
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
7575

76+
- name: Restore npm cache
77+
uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
78+
with:
79+
path: ~/.npm
80+
key: node-${{ steps.versions.outputs.nodeVersion }}-npm-${{ steps.versions.outputs.npmVersion }}-${{ hashFiles('**/package-lock.json') }}
81+
7682
- name: Install node dependencies & build app
7783
run: |
7884
npm ci
7985
TESTING=true npm run build --if-present
8086
87+
- name: Save npm cache
88+
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
89+
with:
90+
path: ~/.npm
91+
key: node-${{ steps.versions.outputs.nodeVersion }}-npm-${{ steps.versions.outputs.npmVersion }}-${{ hashFiles('**/package-lock.json') }}
92+
8193
- name: Save context
8294
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
8395
with:

0 commit comments

Comments
 (0)