From c62ba761976ada3a50b2cef973e7dbd34b0d7820 Mon Sep 17 00:00:00 2001 From: Penelope Yong Date: Tue, 25 Mar 2025 17:22:26 +0000 Subject: [PATCH 1/2] use !cancelled() instead of always() --- .github/workflows/preview.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 8b6f28bc5..4045b7cf6 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -58,7 +58,7 @@ jobs: - name: Save _freeze folder id: cache-save - if: always() + if: ${{ !cancelled() }} uses: actions/cache/save@v4 with: path: | @@ -67,7 +67,7 @@ jobs: - name: Save Julia depot cache id: julia-cache-save - if: always() && steps.julia-cache.outputs.cache-hit != 'true' + if: ${{ !cancelled() && steps.julia-cache.outputs.cache-hit != 'true' }} uses: actions/cache/save@v4 with: path: ${{ steps.julia-cache.outputs.cache-paths }} From 1bc57e751dc0dd492100ab666e21b02ca3c688a4 Mon Sep 17 00:00:00 2001 From: Penelope Yong Date: Tue, 25 Mar 2025 17:42:30 +0000 Subject: [PATCH 2/2] Use same key on publish & preview workflows so that caches can be shared --- .github/workflows/publish.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7ffcc1d23..b5a7c8bd3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -28,7 +28,11 @@ jobs: version: '1.11' - name: Load Julia packages from cache - uses: julia-actions/cache@v2 + id: julia-cache + uses: penelopeysm/julia-cache@main + with: + cache-name: julia-cache;${{ hashFiles('**/Manifest.toml') }} + delete-old-caches: false # Note: needs resolve() to fix #518 - name: Instantiate Julia environment @@ -86,12 +90,21 @@ jobs: - name: Save _freeze folder id: cache-save + if: ${{ !cancelled() }} uses: actions/cache/save@v4 with: path: | ./_freeze/ key: ${{ runner.os }}-${{ hashFiles('**/Manifest.toml') }}-${{ hashFiles('**/index.qmd') }} + - name: Save Julia depot cache + id: julia-cache-save + if: ${{ !cancelled() && steps.julia-cache.outputs.cache-hit != 'true' }} + uses: actions/cache/save@v4 + with: + path: ${{ steps.julia-cache.outputs.cache-paths }} + key: ${{ steps.julia-cache.outputs.cache-key }} + - name: Fetch search_original.json from main site run: curl -O https://raw.githubusercontent.com/TuringLang/turinglang.github.io/gh-pages/search_original.json