Skip to content

Commit bdc4673

Browse files
committed
CI bump to GHC 9.8 and latest majors; use build plan as cache key
1 parent 47a4746 commit bdc4673

File tree

3 files changed

+33
-101
lines changed

3 files changed

+33
-101
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,59 @@
11
name: CI
22
on:
3-
- push
4-
- pull_request
5-
jobs:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
67

8+
jobs:
79
cabal:
810
name: ${{ matrix.os }} - GHC ${{ matrix.ghc }}
911
runs-on: ${{ matrix.os }}
1012
strategy:
1113
matrix:
1214
os: [ubuntu-latest, macOS-latest, windows-latest]
1315
ghc:
14-
- 9.2.7
15-
- 9.4.4
16-
- 9.6.1
16+
- 9.8
17+
- 9.6
18+
- 9.4
19+
- 9.2
1720
fail-fast: false
1821

1922
steps:
20-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2124

22-
- uses: haskell/actions/setup@v2
23-
id: setup-haskell-cabal
24-
name: Setup Haskell
25+
- name: Setup Haskell
26+
uses: haskell-actions/setup@v2
27+
id: setup
2528
with:
2629
ghc-version: ${{ matrix.ghc }}
2730

31+
- name: Configure
32+
run: |
33+
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
34+
cabal build all --dry-run
35+
2836
- name: Restore cache
2937
uses: actions/cache/restore@v3
38+
id: cache
3039
with:
31-
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
32-
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
33-
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
40+
path: ${{ steps.setup.outputs.cabal-store }}
41+
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-plan-${{ hashfiles('dist-newstyle/cache/plan.json') }}
42+
restore-keys: |
43+
${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-
3444
35-
- name: Build
36-
run: |
37-
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
38-
cabal build all
45+
- name: Build dependencies
46+
run: cabal build all --dependencies-only
3947

40-
- name: Test
41-
run: |
42-
cabal test all
48+
- run: cabal build all
49+
- run: cabal test all
50+
- run: cabal haddock
51+
- run: cabal check
52+
- run: cabal sdist
4353

4454
- name: Save cache
4555
uses: actions/cache/save@v3
46-
if: always()
56+
if: always()
4757
with:
48-
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
49-
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
58+
key: ${{ steps.cache.outputs.cache-primary-key }}
59+
path: ${{ steps.setup.outputs.cabal-store }}

stack.yaml

Lines changed: 0 additions & 66 deletions
This file was deleted.

stack.yaml.lock

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)