diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ecf62c902b..47216c265f 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - name: Stack working files cache - uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1.0.1 + - name: Restore stack working files cache + uses: actions/cache/restore@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1 + 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: ${{ github.ref == 'refs/heads/main' }} + uses: actions/cache/save@v4 + 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@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1.0.1 + - name: Restore cache + uses: actions/cache/restore@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1 + 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: ${{ github.ref == 'refs/heads/main' }} + uses: actions/cache/save@v4 + with: + path: | + ~/.cabal/packages + ~/.cabal/store + dist-newstyle + key: ${{ steps.restore-cache.outputs.cache-primary-key }}