diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index acfa86c5a8..af10bc667d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -114,8 +114,9 @@ jobs: runs-on: ${{ matrix.runs-on }} steps: - uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 - - name: Stack working files cache - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + - name: Restore stack working files cache + uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + id: restore-cache with: path: ${{ matrix.cache }} key: stack-${{ runner.os }}-${{ hashFiles('stack.yaml.lock') }} @@ -137,6 +138,12 @@ jobs: result/postgrest result/postgrest.exe if-no-files-found: error + - name: Save stack working files cache + if: startsWith(github.ref, 'refs/heads/') + uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + with: + path: ${{ matrix.cache }} + key: ${{ steps.restore-cache.outputs.cache-primary-key }} freebsd: @@ -170,8 +177,9 @@ jobs: - name: Fix caching run: | mkdir ~/.cabal - - name: Cache - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + - name: Restore cache + uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + id: restore-cache with: path: | ~/.cabal/packages @@ -186,3 +194,12 @@ jobs: cabal build --only-dependencies --enable-tests --enable-benchmarks - name: Build run: cabal build --enable-tests --enable-benchmarks all + - name: Save cache + if: startsWith(github.ref, 'refs/heads/') + uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 + with: + path: | + ~/.cabal/packages + ~/.cabal/store + dist-newstyle + key: ${{ steps.restore-cache.outputs.cache-primary-key }}