Skip to content

Commit db64483

Browse files
committed
ci: migrate from buildjet to cache action
Buildjet stops their service so we must use the github services. ref: https://buildjet.com/for-github-actions/blog/we-are-shutting-down Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent d8417b6 commit db64483

2 files changed

Lines changed: 21 additions & 6 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: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,8 @@ jobs:
8484
npm ci
8585
TESTING=true npm run build --if-present
8686
87-
- name: Show cypress version
88-
run: npm run cypress:version
89-
9087
- name: Save context
91-
uses: buildjet/cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
88+
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
9289
with:
9390
key: cypress-context-${{ github.run_id }}
9491
path: ./
@@ -156,7 +153,8 @@ jobs:
156153

157154
steps:
158155
- name: Restore context
159-
uses: buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
156+
id: cache
157+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
160158
with:
161159
fail-on-cache-miss: true
162160
key: cypress-context-${{ github.run_id }}
@@ -235,6 +233,23 @@ jobs:
235233

236234
name: cypress-summary
237235

236+
permissions:
237+
# `actions:write` permission is required to delete caches
238+
# 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
239+
actions: write
240+
contents: read
241+
238242
steps:
239243
- name: Summary status
240244
run: if ${{ needs.init.result != 'success' || ( needs.cypress.result != 'success' && needs.cypress.result != 'skipped' ) }}; then exit 1; fi
245+
246+
- name: Delete cache on success
247+
run: |
248+
## Setting this to not fail the workflow while deleting cache keys.
249+
set +e
250+
echo "Deleting cache..."
251+
gh cache delete 'cypress-context-${{ github.run_id }}'
252+
echo "Done"
253+
env:
254+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
255+
GH_REPO: ${{ github.repository }}

0 commit comments

Comments
 (0)