47
47
env :
48
48
# We choose a stable ghc version across all os's
49
49
# which will be used to do the next release
50
- GHC_FOR_RELEASE : ' 9.2 .8'
50
+ GHC_FOR_RELEASE : ' 9.4 .8'
51
51
# Ideally we should use the version about to be released for hackage tests and benchmarks
52
- GHC_FOR_SOLVER_BENCHMARKS : ' 9.2 .8'
53
- GHC_FOR_COMPLETE_HACKAGE_TESTS : ' 9.2 .8'
52
+ GHC_FOR_SOLVER_BENCHMARKS : ' 9.4 .8'
53
+ GHC_FOR_COMPLETE_HACKAGE_TESTS : ' 9.4 .8'
54
54
COMMON_FLAGS : ' -j 2 -v'
55
55
56
56
# See https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#hackage-revisions
@@ -66,27 +66,24 @@ jobs:
66
66
GHC_FOR_RELEASE : ${{ format('["{0}"]', env.GHC_FOR_RELEASE) }}
67
67
strategy :
68
68
matrix :
69
- os : [" ubuntu-latest", " macos-latest", " windows-latest" ]
69
+ os : [ubuntu-latest, macos-latest, windows-latest]
70
70
# If you remove something from here.. then add it to the old-ghcs job.
71
- ghc : [" 9.8.1", " 9.6.3", " 9.4.8", " 9.2.8", " 9.0.2", " 8.10.7", " 8.8.4", " 8.6.5" ]
71
+ ghc : [' 9.8.2', ' 9.6.4', ' 9.4.8', ' 9.2.8', ' 9.0.2', ' 8.10.7', ' 8.8.4', ' 8.6.5' ]
72
72
exclude :
73
73
# corrupts GHA cache or the fabric of reality itself, see https://github.com/haskell/cabal/issues/8356
74
- - os : " windows-latest"
75
- ghc : " 8.10.7"
74
+ - os : windows-latest
75
+ ghc : ' 8.10.7'
76
76
# lot of segfaults caused by ghc bugs
77
- - os : " windows-latest"
78
- ghc : " 8.8.4"
79
- # it also throws segfaults randomly
80
- - os : " windows-latest"
81
- ghc : " 8.4.4"
77
+ - os : windows-latest
78
+ ghc : ' 8.8.4'
82
79
# it often randomly does "C:\Users\RUNNER~1\AppData\Local\Temp\ghcFEDE.c: DeleteFile "\\\\?\\C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\ghcFEDE.c": permission denied (Access is denied.)"
83
- - os : " windows-latest"
84
- ghc : " 8.6.5"
80
+ - os : windows-latest
81
+ ghc : ' 8.6.5'
85
82
86
83
steps :
87
84
88
85
- name : Work around XDG directories existence (haskell-actions/setup#62)
89
- if : ${{ runner.os == 'macOS' }}
86
+ if : runner.os == 'macOS'
90
87
run : |
91
88
rm -rf ~/.config/cabal
92
89
rm -rf ~/.cache/cabal
@@ -95,14 +92,20 @@ jobs:
95
92
96
93
# See https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#hackage-revisions
97
94
- name : Manually supplied constraints/allow-newer
98
- if : ${{ github.event_name == 'workflow_dispatch' }}
95
+ if : github.event_name == 'workflow_dispatch'
99
96
run : |
100
- echo 'allow-newer:' ${ALLOWNEWER} >> cabal.project.validate
101
- echo 'constraints:' ${CONSTRAINTS} >> cabal.project.validate
97
+ echo "allow-newer: ${ALLOWNEWER}" >> cabal.project.validate
98
+ echo "constraints: ${CONSTRAINTS}" >> cabal.project.validate
99
+
100
+ - uses : haskell-actions/setup@v2
101
+ id : setup-haskell
102
+ with :
103
+ ghc-version : ${{ matrix.ghc }}
104
+ cabal-version : latest # latest is mandatory for cabal-testsuite, see https://github.com/haskell/cabal/issues/8133
102
105
103
106
# See the following link for a breakdown of the following step
104
107
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
105
- - uses : actions/cache@v3
108
+ - uses : actions/cache@v4
106
109
with :
107
110
# validate.sh uses a special build dir
108
111
path : |
@@ -111,15 +114,8 @@ jobs:
111
114
key : ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
112
115
restore-keys : ${{ runner.os }}-${{ matrix.ghc }}-
113
116
114
- - uses : haskell-actions/setup@v2
115
- id : setup-haskell
116
- with :
117
- ghc-version : ${{ matrix.ghc }}
118
- cabal-version : latest # latest is mandatory for cabal-testsuite, see https://github.com/haskell/cabal/issues/8133
119
-
120
117
- name : Work around git problem https://bugs.launchpad.net/ubuntu/+source/git/+bug/1993586 (cabal PR # 8546)
121
- run : |
122
- git config --global protocol.file.allow always
118
+ run : git config --global protocol.file.allow always
123
119
124
120
# The tool is not essential to the rest of the test suite. If
125
121
# hackage-repo-tool is not present, any test that requires it will
@@ -128,26 +124,23 @@ jobs:
128
124
# hackage-repo-tool breaks or fails to support a newer GHC version.
129
125
- name : Install hackage-repo-tool
130
126
continue-on-error : true
131
- run : |
132
- cd $(mktemp -d)
133
- cabal install hackage-repo-tool
127
+ run : cabal install --ignore-project hackage-repo-tool
134
128
135
129
# Needed by cabal-testsuite/PackageTests/Configure/setup.test.hs
136
130
- name : Install Autotools
137
131
if : runner.os == 'macOS'
138
- run : |
139
- brew install automake
132
+ run : brew install automake
140
133
141
134
- name : Set validate inputs
142
135
run : |
143
136
FLAGS="${{ env.COMMON_FLAGS }}"
144
- if [[ ${{ matrix.ghc }} == ${{ env.GHC_FOR_SOLVER_BENCHMARKS }} ]]; then
137
+ if [[ " ${{ matrix.ghc }}" == " ${{ env.GHC_FOR_SOLVER_BENCHMARKS }}" ]]; then
145
138
FLAGS="$FLAGS --solver-benchmarks"
146
139
fi
147
- if [[ ${{ matrix.ghc }} == ${{ env.GHC_FOR_COMPLETE_HACKAGE_TESTS }} ]]; then
140
+ if [[ " ${{ matrix.ghc }}" == " ${{ env.GHC_FOR_COMPLETE_HACKAGE_TESTS }}" ]]; then
148
141
FLAGS="$FLAGS --complete-hackage-tests"
149
142
fi
150
- echo "FLAGS=$FLAGS" >> $GITHUB_ENV
143
+ echo "FLAGS=$FLAGS" >> " $GITHUB_ENV"
151
144
152
145
- name : Validate print-config
153
146
run : sh validate.sh $FLAGS -s print-config
@@ -164,19 +157,21 @@ jobs:
164
157
CABAL_EXEC=$(cabal list-bin --builddir=dist-newstyle-validate-ghc-${{ matrix.ghc }} --project-file=cabal.project.validate cabal-install:exe:cabal)
165
158
# We have to tar the executable to preserve executable permissions
166
159
# see https://github.com/actions/upload-artifact/issues/38
167
- if [[ ${{ runner.os }} == ' Windows' ]]; then
160
+ if [[ " ${{ runner.os }}" == " Windows" ]]; then
168
161
# `cabal list-bin` gives us a windows path but tar needs the posix one
169
- CABAL_EXEC=$(cygpath $CABAL_EXEC)
162
+ CABAL_EXEC=$(cygpath " $CABAL_EXEC" )
170
163
fi
171
164
if [[ "${{ runner.os }}" == "macOS" ]]; then
172
165
# Workaround to avoid bsdtar corrupts the executable
173
166
# so executing it after untar throws `cannot execute binary file`
174
167
# see https://github.com/actions/virtual-environments/issues/2619#issuecomment-788397841
175
168
sudo /usr/sbin/purge
176
169
fi
177
- export CABAL_EXEC_TAR="cabal-head-${{ runner.os }}-x86_64.tar.gz"
178
- tar -czvf $CABAL_EXEC_TAR -C $(dirname "$CABAL_EXEC") $(basename "$CABAL_EXEC")
179
- echo "CABAL_EXEC_TAR=$CABAL_EXEC_TAR" >> $GITHUB_ENV
170
+ DIR=$(dirname "$CABAL_EXEC")
171
+ FILE=$(basename "$CABAL_EXEC")
172
+ CABAL_EXEC_TAR="cabal-head-${{ runner.os }}-x86_64.tar.gz"
173
+ tar -czvf "$CABAL_EXEC_TAR" -C "$DIR" "$FILE"
174
+ echo "CABAL_EXEC_TAR=$CABAL_EXEC_TAR" >> "$GITHUB_ENV"
180
175
181
176
# We upload the cabal executable built with the ghc used in the release for:
182
177
# - Reuse it in the dogfooding job (although we could use the cached build dir)
@@ -196,81 +191,55 @@ jobs:
196
191
run : sh validate.sh $FLAGS -s lib-tests
197
192
198
193
- name : Validate lib-suite
199
- # Have to disable *-suite validation:
200
- # - the [email protected] problem is tracked at https://github.com/haskell/cabal/issues/8858
201
- # - but curently can't run it with GHC 9.6, tracking: https://github.com/haskell/cabal/issues/8883
202
194
run : sh validate.sh $FLAGS -s lib-suite
203
195
204
196
- name : Validate cli-tests
205
197
run : sh validate.sh $FLAGS -s cli-tests
206
198
207
199
- name : Validate cli-suite
208
- # Have to disable *-suite validation, see above the comment for lib-suite
209
200
run : sh validate.sh $FLAGS -s cli-suite
210
201
211
202
- name : Validate solver-benchmarks-tests
212
- run : |
213
- if [[ ${{ matrix.ghc }} == ${{ env.GHC_FOR_SOLVER_BENCHMARKS }} ]]; then
214
- sh validate.sh $FLAGS -s solver-benchmarks-tests
215
- fi
203
+ if : matrix.ghc == env.GHC_FOR_SOLVER_BENCHMARKS
204
+ run : sh validate.sh $FLAGS -s solver-benchmarks-tests
216
205
217
206
- name : Validate solver-benchmarks-run
218
- run : |
219
- if [[ ${{ matrix.ghc }} == ${{ env.GHC_FOR_SOLVER_BENCHMARKS }} ]]; then
220
- sh validate.sh $FLAGS -s solver-benchmarks-run
221
- fi
207
+ if : matrix.ghc == env.GHC_FOR_SOLVER_BENCHMARKS
208
+ run : sh validate.sh $FLAGS -s solver-benchmarks-run
209
+
222
210
223
211
validate-old-ghcs :
224
212
name : Validate old ghcs ${{ matrix.extra-ghc }}
225
213
runs-on : ubuntu-latest
226
214
needs : validate
227
- # This job needs an older ubuntu (16.04) cause
228
- # the required old ghcs using the `-dyn` flavour
229
- # are not installable from ppa/hvr in newer ones
230
- # see https://github.com/haskell/cabal/issues/8011
231
- container :
232
- image : phadej/ghc:8.8.4-xenial
233
215
234
216
strategy :
235
217
matrix :
236
- # Newer ghc versions than 8.8.4 have to be installed with ghcup cause
237
- # they are not available in ppa/hvr. The ghcup installation
238
- # needs `sudo` which is not available in the xenial container
239
- ghc : ["8.8.4"]
240
- extra-ghc : ["8.4.4", "8.2.2", "8.0.2", "7.10.3", "7.8.4", "7.6.3", "7.4.2", "7.2.2", "7.0.4"]
218
+ ghc : ['9.4.8']
219
+ extra-ghc : ['8.4.4', '8.2.2', '8.0.2', '7.10.3']
241
220
242
221
steps :
243
222
244
- # We can't use actions/checkout with the xenial docker container
245
- # cause it does not work with the git version included in it, see:
246
- # https://github.com/actions/checkout/issues/170
247
- # https://github.com/actions/checkout/issues/295
248
- # - uses: actions/checkout@v4
249
- - name : Checkout
250
- run : |
251
- echo $GITHUB_REF $GITHUB_SHA
252
- git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git .
253
- git fetch origin $GITHUB_SHA:temporary-ci-branch
254
- git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA)
255
-
256
- - name : Install extra compiler
257
- run : |
258
- apt-get update
259
- apt-get install -y ghc-${{ matrix.extra-ghc }}-dyn
223
+ - uses : actions/checkout@v4
260
224
261
- -
uses :
haskell-actions/[email protected]
262
- # From 2.7 the setup action uses node20,
263
- # which is not supported by the phadej/ghc:8.8.4-xenial container.
225
+ - uses : haskell-actions/setup@v2
264
226
id : setup-haskell
265
227
with :
266
228
ghc-version : ${{ matrix.ghc }}
267
- # Make sure this bindist works in this old environment
268
- cabal-version : 3.10.1.0
229
+ cabal-version : latest
230
+
231
+ - name : Install extra compiler
232
+ run : ghcup install ghc ${{ matrix.extra-ghc }}
233
+
234
+ - name : GHC versions
235
+ run : |
236
+ ghc --version
237
+ "ghc-${{ matrix.extra-ghc }}" --version
269
238
270
239
# As we are reusing the cached build dir from the previous step
271
240
# the generated artifacts are available here,
272
241
# including the cabal executable and the test suite
273
- - uses : actions/cache@v3
242
+ - uses : actions/cache@v4
274
243
with :
275
244
path : |
276
245
${{ steps.setup-haskell.outputs.cabal-store }}
@@ -283,13 +252,13 @@ jobs:
283
252
284
253
- name : " Validate lib-suite-extras --extra-hc ghc-${{ matrix.extra-ghc }}"
285
254
env :
286
- EXTRA_GHC : " /opt/ ghc/${{ matrix.extra-ghc }}/bin/ghc- ${{ matrix.extra-ghc }}"
287
- run : sh validate.sh ${{ env.COMMON_FLAGS }} --lib-only -s lib-suite-extras --extra-hc ${{ env.EXTRA_GHC }}
255
+ EXTRA_GHC : ghc- ${{ matrix.extra-ghc }}
256
+ run : sh validate.sh ${{ env.COMMON_FLAGS }} --lib-only -s lib-suite-extras --extra-hc " ${{ env.EXTRA_GHC }}"
288
257
289
258
build-alpine :
290
259
name : Build statically linked using alpine
291
- runs-on : " ubuntu-latest"
292
- container : " alpine:3.19"
260
+ runs-on : ubuntu-latest
261
+ container : ' alpine:3.19'
293
262
steps :
294
263
- name : Install extra dependencies
295
264
shell : sh
@@ -303,14 +272,20 @@ jobs:
303
272
304
273
# See https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#hackage-revisions
305
274
- name : Manually supplied constraints/allow-newer
306
- if : ${{ github.event_name == 'workflow_dispatch' }}
275
+ if : github.event_name == 'workflow_dispatch'
307
276
run : |
308
- echo 'allow-newer:' ${ALLOWNEWER} >> cabal.project.validate
309
- echo 'constraints:' ${CONSTRAINTS} >> cabal.project.validate
277
+ echo "allow-newer: ${ALLOWNEWER}" >> cabal.project.validate
278
+ echo "constraints: ${CONSTRAINTS}" >> cabal.project.validate
279
+
280
+ - uses : haskell-actions/setup@v2
281
+ id : setup-haskell
282
+ with :
283
+ ghc-version : ${{ env.GHC_FOR_RELEASE }}
284
+ cabal-version : latest # latest is mandatory for cabal-testsuite, see https://github.com/haskell/cabal/issues/8133
310
285
311
286
# See the following link for a breakdown of the following step
312
287
# https://github.com/haskell/actions/issues/7#issuecomment-745697160
313
- - uses : actions/cache@v3
288
+ - uses : actions/cache@v4
314
289
with :
315
290
# validate.sh uses a special build dir
316
291
path : |
@@ -319,12 +294,6 @@ jobs:
319
294
key : ${{ runner.os }}-${{ env.GHC_FOR_RELEASE }}-${{ github.sha }}
320
295
restore-keys : ${{ runner.os }}-${{ env.GHC_FOR_RELEASE }}-
321
296
322
- - uses : haskell-actions/setup@v2
323
- id : setup-haskell
324
- with :
325
- ghc-version : ${{ env.GHC_FOR_RELEASE }}
326
- cabal-version : latest # latest is mandatory for cabal-testsuite, see https://github.com/haskell/cabal/issues/8133
327
-
328
297
- name : Enable statically linked executables
329
298
run : |
330
299
echo 'executable-static: true' >> cabal.project.validate
@@ -337,9 +306,11 @@ jobs:
337
306
CABAL_EXEC=$(cabal list-bin --builddir=dist-newstyle-validate-ghc-${{ env.GHC_FOR_RELEASE }} --project-file=cabal.project.validate cabal-install:exe:cabal)
338
307
# We have to tar the executable to preserve executable permissions
339
308
# see https://github.com/actions/upload-artifact/issues/38
340
- export CABAL_EXEC_TAR="cabal-head-${{ runner.os }}-static-x86_64.tar.gz"
341
- tar -czvf $CABAL_EXEC_TAR -C $(dirname "$CABAL_EXEC") $(basename "$CABAL_EXEC")
342
- echo "CABAL_EXEC_TAR=$CABAL_EXEC_TAR" >> $GITHUB_ENV
309
+ DIR=$(dirname "$CABAL_EXEC")
310
+ FILE=$(basename "$CABAL_EXEC")
311
+ CABAL_EXEC_TAR="cabal-head-${{ runner.os }}-static-x86_64.tar.gz"
312
+ tar -czvf "$CABAL_EXEC_TAR" -C "$DIR" "$FILE"
313
+ echo "CABAL_EXEC_TAR=$CABAL_EXEC_TAR" >> "$GITHUB_ENV"
343
314
344
315
- name : Upload cabal-install executable to workflow artifacts
345
316
uses : actions/upload-artifact@v3
@@ -357,31 +328,21 @@ jobs:
357
328
needs : validate
358
329
strategy :
359
330
matrix :
360
- os : [" ubuntu-latest", " macos-latest", " windows-latest" ]
331
+ os : [ubuntu-latest, macos-latest, windows-latest]
361
332
# We only use one ghc version the used one for the next release (defined at top of the workflow)
362
333
# We need to build an array dynamically to inject the appropiate env var in a previous job,
363
334
# see https://docs.github.com/en/actions/learn-github-actions/expressions#fromjson
364
335
ghc : ${{ fromJSON (needs.validate.outputs.GHC_FOR_RELEASE) }}
365
336
366
337
steps :
367
338
- name : Work around XDG directories existence (haskell-actions/setup#62)
368
- if : ${{ runner.os == 'macOS' }}
339
+ if : runner.os == 'macOS'
369
340
run : |
370
341
rm -rf ~/.config/cabal
371
342
rm -rf ~/.cache/cabal
372
343
373
344
- uses : actions/checkout@v4
374
345
375
- # See https://github.com/haskell/cabal/pull/8739
376
- - name : Sudo chmod to permit ghcup to update its cache
377
- run : |
378
- if [[ "${{ runner.os }}" == "Linux" ]]; then
379
- sudo ls -lah /usr/local/.ghcup/cache
380
- sudo mkdir -p /usr/local/.ghcup/cache
381
- sudo ls -lah /usr/local/.ghcup/cache
382
- sudo chown -R $USER /usr/local/.ghcup
383
- sudo chmod -R 777 /usr/local/.ghcup
384
- fi
385
346
- uses : haskell-actions/setup@v2
386
347
id : setup-haskell
387
348
with :
@@ -395,7 +356,7 @@ jobs:
395
356
path : cabal-head
396
357
397
358
- name : Untar the cabal executable
398
- run : tar -xzf ./cabal-head/cabal-head-${{ runner.os }}-x86_64.tar.gz -C cabal-head
359
+ run : tar -xzf " ./cabal-head/cabal-head-${{ runner.os }}-x86_64.tar.gz" -C cabal-head
399
360
400
361
- name : print-config using cabal HEAD
401
362
run : sh validate.sh ${{ env.COMMON_FLAGS }} --with-cabal ./cabal-head/cabal -s print-config
@@ -431,12 +392,12 @@ jobs:
431
392
name : cabal-macOS-x86_64
432
393
433
394
- name : Create GitHub prerelease
434
- uses :
" marvinpinto/[email protected] "
395
+ uses :
marvinpinto/[email protected]
435
396
with :
436
- repo_token : " ${{ secrets.GITHUB_TOKEN }}"
437
- automatic_release_tag : " cabal-head"
397
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
398
+ automatic_release_tag : cabal-head
438
399
prerelease : true
439
- title : " cabal-head"
400
+ title : cabal-head
440
401
files : |
441
402
cabal-head-Windows-x86_64.tar.gz
442
403
cabal-head-Linux-x86_64.tar.gz
0 commit comments