Skip to content

Commit 61387c2

Browse files
committed
Need to cabal update after cache restore
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.
1 parent 3daeefa commit 61387c2

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/haskell.yml

+14-6
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@ jobs:
1313

1414
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
1515
steps:
16-
- uses: actions/checkout@v3
17-
- uses: haskell/actions/setup@v2
18-
with:
19-
ghc-version: ${{ matrix.ghc }}
20-
cabal-version: '3.10.1.0'
16+
2117
- name: Cache
2218
uses: actions/cache@v3
2319
env:
@@ -31,13 +27,25 @@ jobs:
3127
${{ runner.os }}-${{ matrix.ghc }}-
3228
${{ runner.os }}
3329
30+
- uses: actions/checkout@v3
31+
32+
- uses: haskell/actions/setup@v2
33+
with:
34+
ghc-version: ${{ matrix.ghc }}
35+
cabal-version: '3.10.3.0'
36+
3437
- name: Install dependencies
35-
run: cabal build --only-dependencies --enable-tests --enable-benchmarks
38+
run: |
39+
cabal update
40+
cabal build --only-dependencies --enable-tests --enable-benchmarks
41+
3642
- name: Build
3743
run: cabal build --enable-tests --enable-benchmarks all
44+
3845
- name: Run tests
3946
# 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.
4047
run: cabal test --enable-tests -f-hlint all
48+
4149
- if: matrix.ghc != '8.4.4'
4250
# docs aren't built on ghc 8.4.4 because some dependency docs don't build on older GHCs
4351
name: Build Docs

0 commit comments

Comments
 (0)