Skip to content

Commit 5925e16

Browse files
authored
Merge pull request #61947 from nextcloud/ci/drop-buildjet
ci: migrate from buildjet to cache action
2 parents 5d6a26e + 979b404 commit 5925e16

3 files changed

Lines changed: 23 additions & 12 deletions

File tree

‎.github/workflows/command-compile.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ jobs:
9797

9898
steps:
9999
- name: Restore cached git repository
100-
uses: buildjet/cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
100+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
101101
with:
102102
path: .git
103103
key: git-repo

‎.github/workflows/cypress.yml‎

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
111111

112112
- name: Restore npm cache
113-
uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
113+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
114114
with:
115115
path: ~/.npm
116116
key: node-${{ steps.versions.outputs.nodeVersion }}-npm-${{ steps.versions.outputs.npmVersion }}-${{ hashFiles('**/package-lock.json') }}
@@ -121,13 +121,13 @@ jobs:
121121
TESTING=true npm run build --if-present
122122
123123
- name: Save npm cache
124-
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
124+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
125125
with:
126126
path: ~/.npm
127127
key: node-${{ steps.versions.outputs.nodeVersion }}-npm-${{ steps.versions.outputs.npmVersion }}-${{ hashFiles('**/package-lock.json') }}
128128

129129
- name: Save context
130-
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
130+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
131131
with:
132132
key: cypress-context-${{ github.run_id }}
133133
path: ./
@@ -196,7 +196,7 @@ jobs:
196196
steps:
197197
- name: Restore context
198198
id: cache
199-
uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
199+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
200200
with:
201201
key: cypress-context-${{ github.run_id }}
202202
path: ./
@@ -294,12 +294,23 @@ jobs:
294294

295295
name: cypress-summary
296296

297+
permissions:
298+
# `actions:write` permission is required to delete caches
299+
# See also: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id
300+
actions: write
301+
contents: read
302+
297303
steps:
298304
- name: Summary status
299305
run: if ${{ needs.init.result != 'success' || ( needs.cypress.result != 'success' && needs.cypress.result != 'skipped' ) }}; then exit 1; fi
300306

301307
- name: Delete cache on success
302-
uses: buildjet/cache-delete@7184288b8396c4492a56728c47dd286fbd1e96ae # v1
303-
if: needs.init.result == 'success' && needs.cypress.result == 'success'
304-
with:
305-
cache_key: cypress-context-${{ github.run_id }}
308+
run: |
309+
## Setting this to not fail the workflow while deleting cache keys.
310+
set +e
311+
echo "Deleting cache..."
312+
gh cache delete 'cypress-context-${{ github.run_id }}'
313+
echo "Done"
314+
env:
315+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
316+
GH_REPO: ${{ github.repository }}

‎.github/workflows/playwright.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
npm ci
7070
npm run build --if-present
7171
- name: Save context
72-
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
72+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
7373
with:
7474
key: playwright-context-${{ github.run_id }}
7575
path: ./
@@ -91,7 +91,7 @@ jobs:
9191
steps:
9292
- name: Restore context
9393
id: cache
94-
uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
94+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
9595
with:
9696
key: playwright-context-${{ github.run_id }}
9797
path: ./
@@ -156,7 +156,7 @@ jobs:
156156
steps:
157157
- name: Restore context
158158
id: cache
159-
uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
159+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
160160
with:
161161
key: playwright-context-${{ github.run_id }}
162162
path: ./

0 commit comments

Comments
 (0)