diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index f7c7bbe..7bac79a 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -45,7 +45,7 @@ jobs: enable-stack: true stack-no-global: true - - uses: actions/cache/restore@v3 + - uses: actions/cache/restore@v4 name: Cache stack files with: path: ${{ steps.setuphaskell.outputs.stack-root }} @@ -80,7 +80,7 @@ jobs: # https://github.com/commercialhaskell/stack/issues/5024#issuecomment-845001389 stack build --resolver=${{ matrix.snapshot }} --ghc-options=-Werror --test --bench -j 1 - - uses: actions/cache/save@v3 + - uses: actions/cache/save@v4 if: always() with: path: ${{ steps.setuphaskell.outputs.stack-root }} diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml index d3d31cb..906ad5f 100644 --- a/.github/workflows/macOS.yml +++ b/.github/workflows/macOS.yml @@ -41,11 +41,11 @@ jobs: # between builds so we disable cache (that's the reason why we don't build # this along linux and windows, the builds is just too slow, and linux # covers most of the cases for a unix-y OS) - # - uses: actions/cache@main - # name: Cache stack files - # with: - # path: ${{ steps.setuphaskell.outputs.stack-root }} - # key: ${{ runner.os }}-${{ matrix.snapshot }}-stack2 + - uses: actions/cache/restore@v4 + name: Cache stack files + with: + path: ${{ steps.setuphaskell.outputs.stack-root }} + key: ${{ runner.os }}-${{ matrix.snapshot }}-stack2 - name: Setup stack.yaml shell: bash @@ -68,9 +68,16 @@ jobs: echo "stack_root: ${{ steps.setuphaskell.outputs.stack-root }}" stack --version stack --resolver=${{ matrix.snapshot }} ghc -- --version + # we first build everything without running the tests (with unlimited parallelism) stack build --resolver=${{ matrix.snapshot }} --ghc-options=-Werror --test --bench --no-run-tests # once that's done we run the tests in a single threaded fashion to avoid # https://github.com/commercialhaskell/stack/issues/5024#issuecomment-845001389 stack build --resolver=${{ matrix.snapshot }} --ghc-options=-Werror --test --bench -j 1 + + - uses: actions/cache/save@v4 + if: always() + with: + path: ${{ steps.setuphaskell.outputs.stack-root }} + key: ${{ runner.os }}-${{ matrix.snapshot }}-stack2