@@ -3,8 +3,6 @@ name: Build with Cabal
3
3
on :
4
4
push :
5
5
workflow_dispatch :
6
- schedule :
7
- - cron : ' 0 9 * * *'
8
6
9
7
jobs :
10
8
@@ -14,20 +12,22 @@ jobs:
14
12
strategy :
15
13
fail-fast : false
16
14
matrix :
17
- ghc : ['8.10', '9.0 ', '9.2 ', '9.4 ', '9.6 ']
18
- cabal : ['3.10 ']
19
- os : ['ubuntu-20 .04', 'ubuntu-22 .04', 'macOS-latest']
15
+ ghc : ['9.6 ', '9.8 ', '9.10 ', '9.12 ']
16
+ cabal : ['latest ']
17
+ os : ['ubuntu-22 .04', 'ubuntu-24 .04', 'macOS-latest']
20
18
21
19
steps :
22
20
23
21
# Setup
24
22
- name : Checkout repository
25
- uses : actions/checkout@v3
23
+ uses : actions/checkout@v4
24
+
26
25
- name : Install GHC and Cabal
27
- uses : haskell/ actions/setup@v2
26
+ uses : haskell- actions/setup@v2
28
27
with :
29
28
ghc-version : ${{ matrix.ghc }}
30
29
cabal-version : ${{ matrix.cabal }}
30
+
31
31
- name : Configure project
32
32
run : |
33
33
cat > cabal.project.local <<EOF
@@ -38,24 +38,54 @@ jobs:
38
38
EOF
39
39
40
40
# Restore Packages from Caches
41
- - uses : actions/cache@v3
42
- name : Cache dist-newstyle
41
+ - name : Restore cache ~/.cabal/packages and ~/.cabal/store
42
+ id : deps-cache-restore
43
+ uses : actions/cache/restore@v4
43
44
with :
44
45
path : |
45
46
~/.cabal/packages
46
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 : |
47
57
dist-newstyle
48
- key : ${{ matrix.os }}-${{ matrix.ghc }}-0-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
49
62
50
63
# Build
51
64
- name : Update package database
52
65
run : cabal update
66
+
53
67
- name : Configure build
54
68
run : |
55
69
cabal build all --dry-run
56
70
cabal freeze
71
+ cat cabal.project.freeze
72
+
73
+ - name : Show outdated packages
74
+ run : cabal outdated
75
+
57
76
- name : Install build dependencies
58
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
+
59
89
- name : Build library
60
90
run : cabal build
61
91
0 commit comments