Skip to content

Commit

Permalink
Need to cabal update after cache restore
Browse files Browse the repository at this point in the history
Otherwise the cache restore rolls back the hackage index.

Thanks @fgaz for letting me know.

Also changed formatting to match
https://github.com/haskell-actions/setup?tab=readme-ov-file#model-cabal-workflow-with-caching
more.
  • Loading branch information
Ericson2314 committed Sep 27, 2024
1 parent 3daeefa commit 61387c2
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@ jobs:

name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: haskell/actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.10.1.0'

- name: Cache
uses: actions/cache@v3
env:
Expand All @@ -31,13 +27,25 @@ jobs:
${{ runner.os }}-${{ matrix.ghc }}-
${{ runner.os }}
- uses: actions/checkout@v3

- uses: haskell/actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.10.3.0'

- name: Install dependencies
run: cabal build --only-dependencies --enable-tests --enable-benchmarks
run: |
cabal update
cabal build --only-dependencies --enable-tests --enable-benchmarks
- name: Build
run: cabal build --enable-tests --enable-benchmarks all

- name: Run tests
# We don't run hlint tests, because different versions of hlint have different suggestions, and we don't want to worry about satisfying them all.
run: cabal test --enable-tests -f-hlint all

- if: matrix.ghc != '8.4.4'
# docs aren't built on ghc 8.4.4 because some dependency docs don't build on older GHCs
name: Build Docs
Expand Down

0 comments on commit 61387c2

Please sign in to comment.