Skip to content

Commit 4278c3d

Browse files
authored
use !cancelled() instead of always() when caching stuff (#593)
* use !cancelled() instead of always() * Use same key on publish & preview workflows so that caches can be shared
1 parent 795cb7e commit 4278c3d

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

.github/workflows/preview.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858

5959
- name: Save _freeze folder
6060
id: cache-save
61-
if: always()
61+
if: ${{ !cancelled() }}
6262
uses: actions/cache/save@v4
6363
with:
6464
path: |
@@ -67,7 +67,7 @@ jobs:
6767

6868
- name: Save Julia depot cache
6969
id: julia-cache-save
70-
if: always() && steps.julia-cache.outputs.cache-hit != 'true'
70+
if: ${{ !cancelled() && steps.julia-cache.outputs.cache-hit != 'true' }}
7171
uses: actions/cache/save@v4
7272
with:
7373
path: ${{ steps.julia-cache.outputs.cache-paths }}

.github/workflows/publish.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ jobs:
2828
version: '1.11'
2929

3030
- name: Load Julia packages from cache
31-
uses: julia-actions/cache@v2
31+
id: julia-cache
32+
uses: penelopeysm/julia-cache@main
33+
with:
34+
cache-name: julia-cache;${{ hashFiles('**/Manifest.toml') }}
35+
delete-old-caches: false
3236

3337
# Note: needs resolve() to fix #518
3438
- name: Instantiate Julia environment
@@ -86,12 +90,21 @@ jobs:
8690

8791
- name: Save _freeze folder
8892
id: cache-save
93+
if: ${{ !cancelled() }}
8994
uses: actions/cache/save@v4
9095
with:
9196
path: |
9297
./_freeze/
9398
key: ${{ runner.os }}-${{ hashFiles('**/Manifest.toml') }}-${{ hashFiles('**/index.qmd') }}
9499

100+
- name: Save Julia depot cache
101+
id: julia-cache-save
102+
if: ${{ !cancelled() && steps.julia-cache.outputs.cache-hit != 'true' }}
103+
uses: actions/cache/save@v4
104+
with:
105+
path: ${{ steps.julia-cache.outputs.cache-paths }}
106+
key: ${{ steps.julia-cache.outputs.cache-key }}
107+
95108
- name: Fetch search_original.json from main site
96109
run: curl -O https://raw.githubusercontent.com/TuringLang/turinglang.github.io/gh-pages/search_original.json
97110

0 commit comments

Comments
 (0)