Skip to content

Commit 355af46

Browse files
authored
[CI] Save cache on failures (#302)
1 parent e314fbd commit 355af46

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

.github/workflows/benchmark.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ concurrency:
1616
group: ${{ github.workflow }}-${{ github.ref }}
1717
cancel-in-progress: true
1818

19+
# needed to allow julia-actions/cache to delete old caches that it has created
20+
permissions:
21+
actions: write
22+
contents: read
23+
1924
jobs:
2025
benchmark:
2126
timeout-minutes: 90
@@ -26,6 +31,7 @@ jobs:
2631
with:
2732
version: '1.10.2'
2833
- uses: julia-actions/cache@v2
34+
id: julia-cache
2935
with:
3036
cache-name: "benchmarks"
3137
- name: Install dependencies
@@ -64,3 +70,11 @@ jobs:
6470
env:
6571
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6672
SSH_KEY: ${{ secrets.DOCUMENTER_KEY }}
73+
- name: Save Julia depot cache on cancel or failure
74+
id: julia-cache-save
75+
if: cancelled() || failure()
76+
uses: actions/cache/save@v4
77+
with:
78+
path: |
79+
${{ steps.julia-cache.outputs.cache-paths }}
80+
key: ${{ steps.julia-cache.outputs.cache-key }}

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ concurrency:
2222
group: ${{ github.workflow }}-${{ github.ref }}
2323
cancel-in-progress: true
2424

25+
# needed to allow julia-actions/cache to delete old caches that it has created
26+
permissions:
27+
actions: write
28+
contents: read
29+
2530
jobs:
2631
test:
2732
timeout-minutes: 60
@@ -58,6 +63,7 @@ jobs:
5863
version: ${{ matrix.version }}
5964
arch: ${{ matrix.arch }}
6065
- uses: julia-actions/cache@v2
66+
id: julia-cache
6167
with:
6268
cache-name: "tests"
6369
- uses: julia-actions/julia-buildpkg@v1
@@ -68,3 +74,11 @@ jobs:
6874
files: lcov.info
6975
token: ${{ secrets.CODECOV_TOKEN }}
7076
continue-on-error: true
77+
- name: Save Julia depot cache on cancel or failure
78+
id: julia-cache-save
79+
if: cancelled() || failure()
80+
uses: actions/cache/save@v4
81+
with:
82+
path: |
83+
${{ steps.julia-cache.outputs.cache-paths }}
84+
key: ${{ steps.julia-cache.outputs.cache-key }}

.github/workflows/documentation.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ concurrency:
2323
group: ${{ github.workflow }}-${{ github.ref }}
2424
cancel-in-progress: true
2525

26+
# needed to allow julia-actions/cache to delete old caches that it has created
27+
permissions:
28+
actions: write
29+
contents: read
30+
2631
jobs:
2732
build-docs:
2833
timeout-minutes: 30
@@ -31,8 +36,17 @@ jobs:
3136
- uses: actions/checkout@v5
3237
- uses: julia-actions/setup-julia@v2
3338
- uses: julia-actions/cache@v2
39+
id: julia-cache
3440
with:
3541
cache-name: "docs"
3642
- uses: julia-actions/julia-docdeploy@v1
3743
env:
3844
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
45+
- name: Save Julia depot cache on cancel or failure
46+
id: julia-cache-save
47+
if: cancelled() || failure()
48+
uses: actions/cache/save@v4
49+
with:
50+
path: |
51+
${{ steps.julia-cache.outputs.cache-paths }}
52+
key: ${{ steps.julia-cache.outputs.cache-key }}

0 commit comments

Comments
 (0)