@@ -67,63 +67,92 @@ jobs:
67
67
fail-fast : false
68
68
matrix :
69
69
os : [ 'ubuntu-latest', 'macOS-latest', 'windows-latest' ]
70
- ghc : [ '8.10', '9.0', '9.2' ]
70
+ ghc : [ '8.10', '9.0', '9.2', '9.4', '9.6' ]
71
71
72
72
steps :
73
73
- uses : actions/checkout@v3
74
74
75
75
- uses : haskell/actions/setup@v2
76
+ id : setup
76
77
with :
77
78
ghc-version : ${{ matrix.ghc }}
78
- cabal-version : ' 3.8'
79
+ cabal-version : latest
80
+ cabal-update : true
79
81
80
82
- uses : actions/download-artifact@v3
81
83
with :
82
84
name : configure
83
85
84
- - name : Cache
85
- uses : actions/cache@v3
86
- env :
87
- cache-name : cache-cabal
86
+ - name : Haskell versions
87
+ shell : bash
88
+ run : |
89
+ echo "GHC_VERSION=$(ghc --numeric-version)" >> "${GITHUB_ENV}"
90
+ echo "CABAL_VERSION=$(cabal --numeric-version)" >> "${GITHUB_ENV}"
91
+
92
+ - name : Cabal configure
93
+ run : |
94
+ cabal configure --enable-tests --disable-benchmarks --disable-documentation
95
+
96
+ - name : Cache (restore)
97
+ uses : actions/cache/restore@v3
98
+ id : cache
88
99
with :
89
- path : ~/.cabal
90
- key : ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
100
+ path : ${{ steps.setup.outputs.cabal-store }}
101
+ key : build-${{ runner.os }}-ghc-${{ env.GHC_VERSION }}-cabal-${{ env.CABAL_VERSION }}-sha-${{ github.sha }}
102
+ # Append commit SHA so that new cache is always written.
103
+ # This is fine as long as we do not hit the total cache limit of 10GB.
91
104
restore-keys : |
92
- ${{ runner.os }}-build-${{ env.cache-name }}-
93
- ${{ runner.os }}-build-
94
- ${{ runner.os }}-
105
+ build-${{ runner.os }}-ghc-${{ env.GHC_VERSION }}-cabal-${{ env.CABAL_VERSION }}-
106
+ build-${{ runner.os }}-ghc-${{ env.GHC_VERSION }}-
95
107
96
108
- name : Install dependencies
97
109
run : |
98
- cabal update
99
- cabal build --only-dependencies --enable-tests --disable-benchmarks
110
+ cabal build --only-dependencies
111
+
112
+ - name : Cache (save)
113
+ uses : actions/cache/save@v3
114
+ with :
115
+ path : ${{ steps.setup.outputs.cabal-store }}
116
+ key : ${{ steps.cache.outputs.cache-primary-key }}
100
117
101
118
- name : Build
102
- run : cabal build --enable-tests --disable-benchmarks all
119
+ run : |
120
+ cabal build all
103
121
104
122
- name : Run tests
105
- run : cabal test --test-show-details=streaming
123
+ run : |
124
+ cabal test --test-show-details=streaming
106
125
107
126
- name : Run doctest
108
127
if : ${{ runner.os == 'Linux' }}
109
128
run : |
110
129
cabal install doctest --overwrite-policy=always
111
130
cabal repl --build-depends=QuickCheck --with-ghc=doctest
112
131
132
+ - name : Cabal check
133
+ run : |
134
+ cabal check
135
+
136
+ - name : Haddock
137
+ run : |
138
+ cabal haddock --disable-documentation
139
+
113
140
# check windows can generate autoconf too
114
141
- uses : msys2/setup-msys2@v2
115
- if : matrix .os == 'windows-latest'
142
+ if : ${{ runner .os == 'Windows' }}
116
143
with :
117
144
update : true
118
145
install : autoconf
119
- - if : matrix.os == 'windows-latest'
120
- name : autoreconf
146
+
147
+ - name : Autoreconf (Windows)
148
+ if : ${{ runner.os == 'Windows' }}
121
149
shell : msys2 {0}
122
150
run : |
123
151
rm configure include/HsNetworkConfig.h.in
124
152
autoreconf -i
125
- - if : matrix.os == 'windows-latest'
126
- name : Build
153
+
154
+ - name : Build (Windows)
155
+ if : ${{ runner.os == 'Windows' }}
127
156
run : |
128
157
cabal clean
129
158
cabal build --enable-tests --disable-benchmarks all
0 commit comments