Skip to content

Commit 84cb830

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 84cb830

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/haskell.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@ 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
18+
# Needs to be an early step so e.g. `cabal update` isn't undone
2219
uses: actions/cache@v3
2320
env:
2421
cache-name: cache-cabal
@@ -31,13 +28,23 @@ jobs:
3128
${{ runner.os }}-${{ matrix.ghc }}-
3229
${{ runner.os }}
3330
31+
- uses: actions/checkout@v3
32+
33+
- uses: haskell/actions/setup@v2
34+
with:
35+
ghc-version: ${{ matrix.ghc }}
36+
cabal-version: '3.10.1.0'
37+
3438
- name: Install dependencies
3539
run: cabal build --only-dependencies --enable-tests --enable-benchmarks
40+
3641
- name: Build
3742
run: cabal build --enable-tests --enable-benchmarks all
43+
3844
- name: Run tests
3945
# 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.
4046
run: cabal test --enable-tests -f-hlint all
47+
4148
- if: matrix.ghc != '8.4.4'
4249
# docs aren't built on ghc 8.4.4 because some dependency docs don't build on older GHCs
4350
name: Build Docs

0 commit comments

Comments
 (0)