diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index c1a9c529..813b094e 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -16,6 +16,11 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +# needed to allow julia-actions/cache to delete old caches that it has created +permissions: + actions: write + contents: read + jobs: benchmark: timeout-minutes: 90 @@ -26,6 +31,7 @@ jobs: with: version: '1.10.2' - uses: julia-actions/cache@v2 + id: julia-cache with: cache-name: "benchmarks" - name: Install dependencies @@ -64,3 +70,11 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SSH_KEY: ${{ secrets.DOCUMENTER_KEY }} + - name: Save Julia depot cache on cancel or failure + id: julia-cache-save + if: cancelled() || failure() + uses: actions/cache/save@v4 + with: + path: | + ${{ steps.julia-cache.outputs.cache-paths }} + key: ${{ steps.julia-cache.outputs.cache-key }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7db706e3..c9f9dbde 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,11 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +# needed to allow julia-actions/cache to delete old caches that it has created +permissions: + actions: write + contents: read + jobs: test: timeout-minutes: 60 @@ -58,6 +63,7 @@ jobs: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - uses: julia-actions/cache@v2 + id: julia-cache with: cache-name: "tests" - uses: julia-actions/julia-buildpkg@v1 @@ -68,3 +74,11 @@ jobs: files: lcov.info token: ${{ secrets.CODECOV_TOKEN }} continue-on-error: true + - name: Save Julia depot cache on cancel or failure + id: julia-cache-save + if: cancelled() || failure() + uses: actions/cache/save@v4 + with: + path: | + ${{ steps.julia-cache.outputs.cache-paths }} + key: ${{ steps.julia-cache.outputs.cache-key }} diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 9fab4f29..e293506a 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -23,6 +23,11 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +# needed to allow julia-actions/cache to delete old caches that it has created +permissions: + actions: write + contents: read + jobs: build-docs: timeout-minutes: 30 @@ -31,8 +36,17 @@ jobs: - uses: actions/checkout@v5 - uses: julia-actions/setup-julia@v2 - uses: julia-actions/cache@v2 + id: julia-cache with: cache-name: "docs" - uses: julia-actions/julia-docdeploy@v1 env: DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + - name: Save Julia depot cache on cancel or failure + id: julia-cache-save + if: cancelled() || failure() + uses: actions/cache/save@v4 + with: + path: | + ${{ steps.julia-cache.outputs.cache-paths }} + key: ${{ steps.julia-cache.outputs.cache-key }}