8
8
#
9
9
# For more information, see https://github.com/andreasabel/haskell-ci
10
10
#
11
- # version: 0.19.20240703
11
+ # version: 0.19.20241219
12
12
#
13
- # REGENDATA ("0.19.20240703 ",["--config=cabal.haskell-ci","github","cabal.project"])
13
+ # REGENDATA ("0.19.20241219 ",["--config=cabal.haskell-ci","github","cabal.project"])
14
14
#
15
15
name : Haskell-CI
16
16
on :
@@ -32,14 +32,19 @@ jobs:
32
32
strategy :
33
33
matrix :
34
34
include :
35
+ - compiler : ghc-9.12.1
36
+ compilerKind : ghc
37
+ compilerVersion : 9.12.1
38
+ setup-method : ghcup
39
+ allow-failure : false
35
40
- compiler : ghc-9.10.1
36
41
compilerKind : ghc
37
42
compilerVersion : 9.10.1
38
43
setup-method : ghcup
39
44
allow-failure : false
40
- - compiler : ghc-9.8.2
45
+ - compiler : ghc-9.8.4
41
46
compilerKind : ghc
42
- compilerVersion : 9.8.2
47
+ compilerVersion : 9.8.4
43
48
setup-method : ghcup
44
49
allow-failure : false
45
50
- compiler : ghc-9.6.6
@@ -89,15 +94,30 @@ jobs:
89
94
allow-failure : false
90
95
fail-fast : false
91
96
steps :
92
- - name : apt
97
+ - name : apt-get install
93
98
run : |
94
99
apt-get update
95
100
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
101
+ - name : Install GHCup
102
+ run : |
96
103
mkdir -p "$HOME/.ghcup/bin"
97
- curl -sL https://downloads.haskell.org/ghcup/0.1.20 .0/x86_64-linux-ghcup-0.1.20 .0 > "$HOME/.ghcup/bin/ghcup"
104
+ curl -sL https://downloads.haskell.org/ghcup/0.1.30 .0/x86_64-linux-ghcup-0.1.30 .0 > "$HOME/.ghcup/bin/ghcup"
98
105
chmod a+x "$HOME/.ghcup/bin/ghcup"
106
+ - name : Install cabal-install (prerelease)
107
+ run : |
108
+ "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
109
+ "$HOME/.ghcup/bin/ghcup" install cabal 3.15.0.0.2024.10.3 || (cat "$HOME"/.ghcup/logs/*.* && false)
110
+ echo "CABAL=$HOME/.ghcup/bin/cabal-3.15.0.0.2024.10.3 -vnormal+nowrap" >> "$GITHUB_ENV"
111
+ - name : Install GHC (GHCup)
112
+ if : matrix.setup-method == 'ghcup'
113
+ run : |
99
114
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
100
- "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
115
+ HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
116
+ HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
117
+ HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
118
+ echo "HC=$HC" >> "$GITHUB_ENV"
119
+ echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
120
+ echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
101
121
env :
102
122
HCKIND : ${{ matrix.compilerKind }}
103
123
HCNAME : ${{ matrix.compiler }}
@@ -108,21 +128,12 @@ jobs:
108
128
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
109
129
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
110
130
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
111
- HCDIR=/opt/$HCKIND/$HCVER
112
- HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
113
- HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
114
- HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
115
- echo "HC=$HC" >> "$GITHUB_ENV"
116
- echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
117
- echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
118
- echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
119
131
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
120
132
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
121
133
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
122
134
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
123
- echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
135
+ if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE= false" >> "$GITHUB_ENV" ; fi
124
136
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
125
- echo "GHCJSARITH=0" >> "$GITHUB_ENV"
126
137
env :
127
138
HCKIND : ${{ matrix.compilerKind }}
128
139
HCNAME : ${{ matrix.compiler }}
@@ -149,6 +160,18 @@ jobs:
149
160
repository hackage.haskell.org
150
161
url: http://hackage.haskell.org/
151
162
EOF
163
+ if $HEADHACKAGE; then
164
+ cat >> $CABAL_CONFIG <<EOF
165
+ repository head.hackage.ghc.haskell.org
166
+ url: https://ghc.gitlab.haskell.org/head.hackage/
167
+ secure: True
168
+ root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
169
+ 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
170
+ f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
171
+ key-threshold: 3
172
+ active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
173
+ EOF
174
+ fi
152
175
cat >> $CABAL_CONFIG <<EOF
153
176
program-default-options
154
177
ghc-options: $GHCJOBS +RTS -M3G -RTS
@@ -209,8 +232,10 @@ jobs:
209
232
constraints: github-samples +openssl
210
233
constraints: operational -buildExamples
211
234
optimization: False
212
- allow-newer: containers
213
235
EOF
236
+ if $HEADHACKAGE; then
237
+ echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
238
+ fi
214
239
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(github|github-samples)$/; }' >> cabal.project.local
215
240
cat cabal.project
216
241
cat cabal.project.local
@@ -250,19 +275,9 @@ jobs:
250
275
run : |
251
276
rm -f cabal.project.local
252
277
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
253
- - name : prepare for constraint sets
254
- run : |
255
- rm -f cabal.project.local
256
- - name : constraint set containers-0.7
257
- run : |
258
- if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers >= 0.7' all --dry-run ; fi
259
- if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then cabal-plan topo | sort ; fi
260
- if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers >= 0.7' --dependencies-only -j2 all ; fi
261
- if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers >= 0.7' all ; fi
262
- if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='containers >= 0.7' all ; fi
263
278
- name : save cache
264
- uses : actions/cache/save@v4
265
279
if : always()
280
+ uses : actions/cache/save@v4
266
281
with :
267
282
key : ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
268
283
path : ~/.cabal/store
0 commit comments