Skip to content

Commit c0ac897

Browse files
odrEricson2314
authored andcommitted
build with 9.10.1. Clean warnings and upd CI
1 parent 3daeefa commit c0ac897

File tree

1 file changed

+41
-21
lines changed

1 file changed

+41
-21
lines changed

.github/workflows/haskell.yml

+41-21
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,52 @@ jobs:
1313

1414
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
1515
steps:
16-
- uses: actions/checkout@v3
17-
- uses: haskell/actions/setup@v2
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up GHC ${{ matrix.ghc-version }}
19+
uses: haskell-actions/setup@v2
20+
id: setup
1821
with:
1922
ghc-version: ${{ matrix.ghc }}
20-
cabal-version: '3.10.1.0'
21-
- name: Cache
22-
uses: actions/cache@v3
23+
24+
- name: Configure the build
25+
run: |
26+
cabal configure --enable-tests --enable-benchmarks --enable-documentation
27+
cabal build all --dry-run
28+
# The last step generates dist-newstyle/cache/plan.json for the cache key.
29+
30+
- name: Restore cached dependencies
31+
uses: actions/cache/restore@v4
32+
id: cache
2333
env:
24-
cache-name: cache-cabal
34+
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
2535
with:
26-
path: ~/.cabal
27-
key: ${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
28-
restore-keys: |
29-
${{ runner.os }}-${{ matrix.ghc }}-build-${{ env.cache-name }}-
30-
${{ runner.os }}-${{ matrix.ghc }}-build-
31-
${{ runner.os }}-${{ matrix.ghc }}-
32-
${{ runner.os }}
36+
path: ${{ steps.setup.outputs.cabal-store }}
37+
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
38+
restore-keys: ${{ env.key }}-
3339

3440
- name: Install dependencies
35-
run: cabal build --only-dependencies --enable-tests --enable-benchmarks
41+
# If we had an exact cache hit, the dependencies will be up to date.
42+
if: steps.cache.outputs.cache-hit != 'true'
43+
run: cabal build all --only-dependencies
44+
45+
# Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
46+
- name: Save cached dependencies
47+
uses: actions/cache/save@v4
48+
# If we had an exact cache hit, trying to save the cache would error because of key clash.
49+
if: steps.cache.outputs.cache-hit != 'true'
50+
with:
51+
path: ${{ steps.setup.outputs.cabal-store }}
52+
key: ${{ steps.cache.outputs.cache-primary-key }}
53+
3654
- name: Build
37-
run: cabal build --enable-tests --enable-benchmarks all
55+
run: cabal build all
56+
3857
- name: Run tests
39-
# 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.
40-
run: cabal test --enable-tests -f-hlint all
41-
- if: matrix.ghc != '8.4.4'
42-
# docs aren't built on ghc 8.4.4 because some dependency docs don't build on older GHCs
43-
name: Build Docs
44-
run: cabal haddock
58+
run: cabal test all
59+
60+
- name: Check cabal file
61+
run: cabal check
62+
63+
- name: Build documentation
64+
run: cabal haddock all

0 commit comments

Comments
 (0)