Skip to content

Commit e67c77a

Browse files
committed
chore(e2e): Replace deprecate buildjet with native github cache
Signed-off-by: David Dreschner <david.dreschner@nextcloud.com>
1 parent ae35f81 commit e67c77a

2 files changed

Lines changed: 31 additions & 21 deletions

File tree

.github/workflows/cypress.yml

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ jobs:
9292

9393
- name: Install composer dependencies
9494
if: steps.check_composer.outputs.files_exists == 'true'
95-
run: composer install --no-dev
95+
uses: "ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda" # 4.0.0
96+
with:
97+
composer-options: '--no-dev'
9698

9799
- name: Read package.json node and npm engines version
98100
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
@@ -105,29 +107,19 @@ jobs:
105107
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
106108
with:
107109
node-version: ${{ steps.versions.outputs.nodeVersion }}
110+
cache: 'npm'
111+
cache-dependency-path: '**/package-lock.json'
108112

109113
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
110114
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
111115

112-
- name: Restore npm cache
113-
uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
114-
with:
115-
path: ~/.npm
116-
key: node-${{ steps.versions.outputs.nodeVersion }}-npm-${{ steps.versions.outputs.npmVersion }}-${{ hashFiles('**/package-lock.json') }}
117-
118116
- name: Install node dependencies & build app
119117
run: |
120118
npm ci
121119
TESTING=true npm run build --if-present
122120
123-
- name: Save npm cache
124-
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
125-
with:
126-
path: ~/.npm
127-
key: node-${{ steps.versions.outputs.nodeVersion }}-npm-${{ steps.versions.outputs.npmVersion }}-${{ hashFiles('**/package-lock.json') }}
128-
129121
- name: Save context
130-
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
122+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
131123
with:
132124
key: cypress-context-${{ github.run_id }}
133125
path: ./
@@ -196,7 +188,7 @@ jobs:
196188
steps:
197189
- name: Restore context
198190
id: cache
199-
uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
191+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
200192
with:
201193
key: cypress-context-${{ github.run_id }}
202194
path: ./
@@ -218,12 +210,16 @@ jobs:
218210

219211
- name: Install composer dependencies
220212
if: steps.check_composer.outputs.files_exists == 'true' && steps.cache.outputs.cache-hit != 'true'
221-
run: composer install --no-dev
213+
uses: "ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda" # 4.0.0
214+
with:
215+
composer-options: '--no-dev'
222216

223217
- name: Set up node ${{ needs.init.outputs.nodeVersion }}
224218
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
225219
with:
226220
node-version: ${{ needs.init.outputs.nodeVersion }}
221+
cache: 'npm'
222+
cache-dependency-path: '**/package-lock.json'
227223

228224
- name: Set up npm ${{ needs.init.outputs.npmVersion }}
229225
run: npm i -g 'npm@${{ needs.init.outputs.npmVersion }}'
@@ -299,7 +295,8 @@ jobs:
299295
run: if ${{ needs.init.result != 'success' || ( needs.cypress.result != 'success' && needs.cypress.result != 'skipped' ) }}; then exit 1; fi
300296

301297
- name: Delete cache on success
302-
uses: buildjet/cache-delete@7184288b8396c4492a56728c47dd286fbd1e96ae # v1
298+
uses: snnaplab/delete-branch-cache-action@20f7992a7b8b51aa719420d11b32c9d34a5eb362 # v1.0.0
303299
if: needs.init.result == 'success' && needs.cypress.result == 'success'
304300
with:
305-
cache_key: cypress-context-${{ github.run_id }}
301+
ref: refs/pull/${{ github.event.number }}/merge
302+
key: cypress-context-${{ github.run_id }}

.github/workflows/playwright.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,16 @@ jobs:
6262
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
6363
with:
6464
node-version: ${{ steps.versions.outputs.node-version }}
65+
cache: 'npm'
66+
cache-dependency-path: '**/package-lock.json'
6567
- name: Set up npm
6668
run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}'
6769
- name: Install dependencies and build
6870
run: |
6971
npm ci
7072
npm run build --if-present
7173
- name: Save context
72-
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
74+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
7375
with:
7476
key: playwright-context-${{ github.run_id }}
7577
path: ./
@@ -91,7 +93,7 @@ jobs:
9193
steps:
9294
- name: Restore context
9395
id: cache
94-
uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
96+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
9597
with:
9698
key: playwright-context-${{ github.run_id }}
9799
path: ./
@@ -112,6 +114,8 @@ jobs:
112114
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
113115
with:
114116
node-version: ${{ steps.versions.outputs.node-version }}
117+
cache: 'npm'
118+
cache-dependency-path: '**/package-lock.json'
115119

116120
- name: Set up npm
117121
if: steps.cache.outputs.cache-hit != 'true'
@@ -156,7 +160,7 @@ jobs:
156160
steps:
157161
- name: Restore context
158162
id: cache
159-
uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
163+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
160164
with:
161165
key: playwright-context-${{ github.run_id }}
162166
path: ./
@@ -170,6 +174,8 @@ jobs:
170174
if: steps.cache.outputs.cache-hit != 'true'
171175
with:
172176
node-version: ${{ needs.playwright-tests.outputs.node-version }}
177+
cache: 'npm'
178+
cache-dependency-path: '**/package-lock.json'
173179

174180
- name: Set up npm
175181
if: steps.cache.outputs.cache-hit != 'true'
@@ -215,3 +221,10 @@ jobs:
215221
steps:
216222
- name: Summary status
217223
run: if ${{ needs.playwright-tests.result != 'success' }}; then exit 1; fi
224+
225+
- name: Delete cache on success
226+
uses: snnaplab/delete-branch-cache-action@20f7992a7b8b51aa719420d11b32c9d34a5eb362 # v1.0.0
227+
if: needs.playwright-tests.result == 'success'
228+
with:
229+
ref: refs/pull/${{ github.event.number }}/merge
230+
key: playwright-context-${{ github.run_id }}

0 commit comments

Comments
 (0)