@@ -10,26 +10,23 @@ jobs:
10
10
strategy :
11
11
fail-fast : false
12
12
matrix :
13
- ghc : ['8.10.7 ', '9.0.1 ', '9.2 ', '9.4 ', '9.6 ']
14
- cabal : ['3.10 ']
15
- os : ['ubuntu-22.04', 'ubuntu-20 .04', 'macOS-latest']
13
+ ghc : ['9.4 ', '9.6 ', '9.8 ', '9.10 ', '9.12 ']
14
+ cabal : ['latest ']
15
+ os : ['ubuntu-22.04', 'ubuntu-24 .04', 'macOS-latest']
16
16
remoteConfigs : ['-remote-configs', '+remote-configs']
17
- include :
18
- - ghc : ' 9.2'
19
- cabal : ' 3.6'
20
- os : ' ubuntu-22.04'
21
- remoteConfigs : ' +remote-configs'
22
17
23
18
steps :
24
19
25
20
# Setup
26
21
- name : Checkout repository
27
- uses : actions/checkout@v3
22
+ uses : actions/checkout@v4
23
+
28
24
- name : Install GHC and Cabal
29
- uses : haskell/ actions/setup@v2
25
+ uses : haskell- actions/setup@v2
30
26
with :
31
27
ghc-version : ${{ matrix.ghc }}
32
28
cabal-version : ${{ matrix.cabal }}
29
+
33
30
- name : Configure project
34
31
run : |
35
32
cat > cabal.project.local <<EOF
@@ -41,24 +38,54 @@ jobs:
41
38
EOF
42
39
43
40
# Restore Packages from Caches
44
- - uses : actions/cache@v3
45
- name : Cache cabal packages
41
+ - name : Restore cache ~/.cabal/packages and ~/.cabal/store
42
+ id : deps-cache-restore
43
+ uses : actions/cache/restore@v4
46
44
with :
47
45
path : |
48
46
~/.cabal/packages
49
47
~/.cabal/store
48
+ key : deps-${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.local') }}
49
+ restore-keys : |
50
+ deps-${{ matrix.os }}-${{ matrix.ghc }}-
51
+
52
+ # Restore dist-newstyle
53
+ - name : Cache dist-newstyle
54
+ uses : actions/cache@v4
55
+ with :
56
+ path : |
50
57
dist-newstyle
51
- key : ${{ matrix.os }}-${{ matrix.ghc }}-cabal
58
+ key : dist-${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.local') }}
59
+ restore-keys : |
60
+ dist-${{ matrix.os }}-${{ matrix.ghc }}-
61
+ save-always : true
52
62
53
63
# Build
54
64
- name : Update package database
55
65
run : cabal update
66
+
56
67
- name : Configure build
57
68
run : |
58
69
cabal build all --dry-run
59
70
cabal freeze
71
+ cat cabal.project.freeze
72
+
73
+ - name : Show outdated packages
74
+ run : cabal outdated
75
+
60
76
- name : Install build dependencies
61
77
run : cabal build --only-dependencies
78
+
79
+ # Save packages
80
+ - name : Save cache for ~/.cabal/packages and ~/.cabal/store
81
+ uses : actions/cache/save@v4
82
+ if : always()
83
+ with :
84
+ path : |
85
+ ~/.cabal/packages
86
+ ~/.cabal/store
87
+ key : ${{ steps.deps-cache-restore.outputs.cache-primary-key }}
88
+
62
89
- name : Build library
63
90
run : cabal build
64
91
0 commit comments