Skip to content

Commit b1ae676

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 c8b29c9 commit b1ae676

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/cypress.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,25 @@ 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+
restore-keys: |
82+
node-${{ steps.versions.outputs.nodeVersion }}-npm-${{ steps.versions.outputs.npmVersion }}-
83+
7684
- name: Install node dependencies & build app
7785
run: |
7886
npm ci
7987
TESTING=true npm run build --if-present
8088
89+
- name: Save npm cache
90+
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
91+
with:
92+
path: ~/.npm
93+
key: node-${{ steps.versions.outputs.nodeVersion }}-npm-${{ steps.versions.outputs.npmVersion }}-${{ hashFiles('**/package-lock.json') }}
94+
8195
- name: Save context
8296
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
8397
with:

0 commit comments

Comments
 (0)