15
15
strategy :
16
16
fail-fast : false
17
17
matrix :
18
- ghc : ['9.8.1 ', '9.6.4 ', '9.4.8 ']
18
+ ghc : ['9.8', '9.6', '9.4']
19
19
os : [ubuntu-latest, macOS-latest, windows-latest]
20
20
steps :
21
21
- uses : actions/checkout@v4
@@ -24,24 +24,31 @@ jobs:
24
24
id : setup
25
25
with :
26
26
ghc-version : ${{ matrix.ghc }}
27
- # cabal-version: '3.8.1.0'
27
+ # cabal-version: latest
28
28
cabal-update : true
29
29
30
- - name : Cache
31
- uses : actions/cache@v4
30
+ - name : Restore cache
31
+ uses : actions/cache/restore@v4
32
+ id : cache
32
33
env :
33
- cache-name : haskell.yml
34
+ key : ${{ runner.os }}-cabal-${{ steps.setup.outputs.cabal-version }}-ghc-${{ steps.setup.outputs.ghc-version }}
34
35
with :
35
36
path : ${{ steps.setup.outputs.cabal-store }}
36
- key : ${{ runner.os }}-${{ env.cache-name }}-ghc- ${{ matrix.ghc }}-${{ hashFiles('**/*.cabal', '**/cabal.project') }}
37
- restore-keys : ${{ runner.os }}-${{ env.cache-name }}-ghc-${{ matrix.ghc }}-
37
+ key : ${{ env.key }}-${{ github.sha }}
38
+ restore-keys : ${{ env.key }}-
38
39
39
40
- name : Install dependencies
40
- run : |
41
- cabal build --only-dependencies --enable-tests --enable-benchmarks -vnormal+nowrap all
41
+ run : cabal build --only-dependencies --enable-tests --enable-benchmarks -vnormal+nowrap all
42
42
43
43
- name : Build
44
44
run : cabal build --enable-tests --enable-benchmarks -j1 -vnormal+nowrap all
45
45
46
46
- name : Run tests
47
47
run : cabal test -j1 -vnormal+nowrap all
48
+
49
+ - name : Cache dependencies
50
+ uses : actions/cache/save@v4
51
+ if : always()
52
+ with :
53
+ path : ${{ steps.setup.outputs.cabal-store }}
54
+ key : ${{ steps.cache.outputs.cache-primary-key }}
0 commit comments