-
Notifications
You must be signed in to change notification settings - Fork 1
310 lines (260 loc) · 10.2 KB
/
ci.yml
File metadata and controls
310 lines (260 loc) · 10.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
name: CI
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
permissions:
contents: read
jobs:
test-ghc-os:
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
ghc:
- "8.8.4"
- "8.10.7"
- "9.0.2"
- "9.2.8"
- "9.4.8"
- "9.6.7"
- "9.8.4"
- "9.10.3"
- "9.12.2"
- "9.14.1"
steps:
- name: "checkout"
uses: actions/checkout@v4
- name: "setup Haskell"
uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: latest
cabal-update: false
enable-stack: true
stack-version: latest
- name: "update Cabal"
run: cabal update
- name: "setup environment"
run: |
GHC_VERSION=$(ghc --numeric-version)
CABAL_OPTS=""
if [ -f "cabal-${GHC_VERSION}.project" ] ; then
CABAL_OPTS="--project-file=cabal-${GHC_VERSION}.project"
fi
echo "CABAL_OPTS=${CABAL_OPTS}" | tee -a "${GITHUB_ENV}"
STACK_YAML="stack-${GHC_VERSION}.yaml"
echo "STACK_YAML=${STACK_YAML}" | tee -a "${GITHUB_ENV}"
TS_YYYYMM="$(date +%Y%m)"
echo "TS_YYYYMM=${TS_YYYYMM}" | tee -a "${GITHUB_ENV}"
- name: "cabal: configure build"
run: |
cabal configure $CABAL_OPTS --enable-tests --enable-benchmarks --disable-documentation
cabal build all --dry-run $CABAL_OPTS
- name: "cabal: restore cache"
uses: actions/cache/restore@v4
id: cache-cabal
env:
key: ${{ runner.os }}-${{ env.TS_YYYYMM }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-
- if: ${{ !steps.cache-cabal.outputs.cache-hit }}
name: "cabal: install dependencies"
run: cabal build all $CABAL_OPTS --only-dependencies
- if: ${{ !steps.cache-cabal.outputs.cache-hit }}
name: "cabal: save cache"
uses: actions/cache/save@v4
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache-cabal.outputs.cache-primary-key }}
- name: "cabal: ttc: build"
run: cabal build ttc $CABAL_OPTS
- name: "cabal: ttc: test"
run: cabal test ttc $CABAL_OPTS
- name: "cabal: ttc: haddock"
run: cabal haddock ttc $CABAL_OPTS
- name: "cabal: ttc: examples"
run: cabal build ttc-examples $CABAL_OPTS
- if: matrix.ghc == '8.8.4'
name: "ttc lower bounds: setup environment"
run: |
cabal clean
rm -rf ~/.cabal/store
CABAL_OPTS="--project-file=cabal-ttc-bounds-lower.project"
echo "CABAL_OPTS=${CABAL_OPTS}" | tee -a "${GITHUB_ENV}"
- if: matrix.ghc == '8.8.4'
name: "ttc lower bounds: configure build"
run: |
cabal configure $CABAL_OPTS --enable-tests --enable-benchmarks --disable-documentation
cabal build ttc ttc-examples --dry-run $CABAL_OPTS
- if: matrix.ghc == '8.8.4'
name: "ttc lower bounds: restore cache"
uses: actions/cache/restore@v4
id: cache-ttc-bounds-lower
env:
key: ${{ runner.os }}-${{ env.TS_YYYYMM }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}-ttc-bounds-lower
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-
- if: ${{ matrix.ghc == '8.8.4' && !steps.cache-ttc-bounds-lower.outputs.cache-hit }}
name: "ttc lower bounds: install dependencies"
run: cabal build ttc ttc-examples $CABAL_OPTS --only-dependencies
- if: ${{ matrix.ghc == '8.8.4' && !steps.cache-ttc-bounds-lower.outputs.cache-hit }}
name: "ttc lower bounds: save cache"
uses: actions/cache/save@v4
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache-ttc-bounds-lower.outputs.cache-primary-key }}
- if: matrix.ghc == '8.8.4'
name: "ttc lower bounds: build"
run: cabal build ttc $CABAL_OPTS
- if: matrix.ghc == '8.8.4'
name: "ttc lower bounds: test"
run: cabal test ttc $CABAL_OPTS
- if: matrix.ghc == '8.8.4'
name: "ttc lower bounds: haddock"
run: cabal haddock ttc $CABAL_OPTS
- if: matrix.ghc == '8.8.4'
name: "ttc lower bounds: examples"
run: cabal build ttc-examples $CABAL_OPTS
- if: matrix.ghc == '9.14.1'
name: "ttc upper bounds: setup environment"
run: |
cabal clean
rm -rf ~/.cabal/store
CABAL_OPTS="--project-file=cabal-ttc-bounds-upper.project"
echo "CABAL_OPTS=${CABAL_OPTS}" | tee -a "${GITHUB_ENV}"
- if: matrix.ghc == '9.14.1'
name: "ttc upper bounds: configure build"
run: |
cabal configure $CABAL_OPTS --enable-tests --enable-benchmarks --disable-documentation
cabal build ttc ttc-examples --dry-run $CABAL_OPTS
- if: matrix.ghc == '9.14.1'
name: "ttc upper bounds: restore cache"
uses: actions/cache/restore@v4
id: cache-ttc-bounds-upper
env:
key: ${{ runner.os }}-${{ env.TS_YYYYMM }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}-ttc-bounds-upper
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-
- if: ${{ matrix.ghc == '9.14.1' && !steps.cache-ttc-bounds-upper.outputs.cache-hit }}
name: "ttc upper bounds: install dependencies"
run: cabal build ttc ttc-examples $CABAL_OPTS --only-dependencies
- if: ${{ matrix.ghc == '9.14.1' && !steps.cache-ttc-bounds-upper.outputs.cache-hit }}
name: "ttc upper bounds: save cache"
uses: actions/cache/save@v4
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache-ttc-bounds-upper.outputs.cache-primary-key }}
- if: matrix.ghc == '9.14.1'
name: "ttc upper bounds: build"
run: cabal build ttc $CABAL_OPTS
- if: matrix.ghc == '9.14.1'
name: "ttc upper bounds: test"
run: cabal test ttc $CABAL_OPTS
- if: matrix.ghc == '9.14.1'
name: "ttc upper bounds: haddock"
run: cabal haddock ttc $CABAL_OPTS
- if: matrix.ghc == '9.14.1'
name: "ttc upper bounds: examples"
run: cabal build ttc-examples $CABAL_OPTS
- name: "stack: configure build"
run: stack --system-ghc ls dependencies json > stack-deps.json
- name: "stack: restore cache"
uses: actions/cache/restore@v4
id: cache-stack
env:
key: ${{ runner.os }}-${{ env.TS_YYYYMM }}-ghc-${{ steps.setup.outputs.ghc-version }}-stack
with:
path: ~/.stack
key: ${{ env.key }}-${{ hashFiles('stack-deps.json') }}
restore-keys: ${{ env.key }}-
- name: "stack: ttc: build"
run: stack build ttc --system-ghc --test --bench --no-run-tests --no-run-benchmarks
- name: "stack: ttc: test"
run: stack test ttc --system-ghc
- name: "stack: ttc: haddock"
run: stack haddock ttc --system-ghc
- name: "stack: ttc: examples"
run: stack build ttc-examples --system-ghc
- if: ${{ !steps.cache-stack.outputs.cache-hit }}
name: "stack: save cache"
uses: actions/cache/save@v4
with:
path: ~/.stack
key: ${{ steps.cache-stack.outputs.cache-primary-key }}
test-ghc884-cabal3000:
name: Cabal ${{ matrix.cabal }} (GHC ${{ matrix.ghc }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
ghc:
- "8.8.4"
cabal:
- "3.0.0.0"
steps:
- name: "checkout"
uses: actions/checkout@v4
- name: "setup Haskell"
uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
cabal-update: true
- name: "setup environment"
run: |
GHC_VERSION=$(ghc --numeric-version)
CABAL_OPTS=""
if [ -f "cabal-${GHC_VERSION}.project" ] ; then
CABAL_OPTS="--project-file=cabal-${GHC_VERSION}.project"
fi
echo "CABAL_OPTS=${CABAL_OPTS}" | tee -a "${GITHUB_ENV}"
TS_YYYYMM="$(date +%Y%m)"
echo "TS_YYYYMM=${TS_YYYYMM}" | tee -a "${GITHUB_ENV}"
- name: "configure build"
run: |
cabal v2-configure $CABAL_OPTS --enable-tests --enable-benchmarks --disable-documentation
cabal v2-build all --dry-run $CABAL_OPTS
- name: "restore cache"
uses: actions/cache/restore@v4
id: cache-cabal
env:
key: ${{ runner.os }}-${{ env.TS_YYYYMM }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-
- if: ${{ !steps.cache-cabal.outputs.cache-hit }}
name: "install dependencies"
run: cabal v2-build all $CABAL_OPTS --only-dependencies
- if: ${{ !steps.cache-cabal.outputs.cache-hit }}
name: "save cache"
uses: actions/cache/save@v4
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache-cabal.outputs.cache-primary-key }}
- name: "ttc: build"
run: cabal v2-build ttc $CABAL_OPTS
- name: "ttc: test"
run: cabal v2-test ttc $CABAL_OPTS
- name: "ttc: haddock"
run: cabal v2-haddock ttc $CABAL_OPTS
- name: "ttc: examples"
run: cabal v2-build ttc-examples $CABAL_OPTS