Skip to content

Commit d8494b0

Browse files
committed
CI: Add ghc 9.12 to the build matrix
1 parent fe7a620 commit d8494b0

File tree

2 files changed

+87
-22
lines changed

2 files changed

+87
-22
lines changed

.github/workflows/haskell-ci.yml

+85-21
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.19.20240514
11+
# version: 0.19.20241121
1212
#
13-
# REGENDATA ("0.19.20240514",["github","--config=cabal.haskell-ci","text.cabal"])
13+
# REGENDATA ("0.19.20241121",["github","--config=cabal.haskell-ci","text.cabal"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -28,19 +28,34 @@ jobs:
2828
strategy:
2929
matrix:
3030
include:
31+
- compiler: ghc-9.12.0.20241114
32+
compilerKind: ghc
33+
compilerVersion: 9.12.0.20241114
34+
setup-method: ghcup
35+
allow-failure: false
36+
- compiler: ghc-9.12.0.20241114
37+
compilerKind: ghc
38+
compilerVersion: 9.12.0.20241114
39+
setup-method: ghcup-prerelease
40+
allow-failure: false
3141
- compiler: ghc-9.10.1
3242
compilerKind: ghc
3343
compilerVersion: 9.10.1
3444
setup-method: ghcup
3545
allow-failure: false
36-
- compiler: ghc-9.8.2
46+
- compiler: ghc-9.8.3
3747
compilerKind: ghc
38-
compilerVersion: 9.8.2
48+
compilerVersion: 9.8.3
3949
setup-method: ghcup
4050
allow-failure: false
41-
- compiler: ghc-9.6.4
51+
- compiler: ghc-9.8.3
52+
compilerKind: ghc
53+
compilerVersion: 9.8.3
54+
setup-method: ghcup-vanilla
55+
allow-failure: false
56+
- compiler: ghc-9.6.6
4257
compilerKind: ghc
43-
compilerVersion: 9.6.4
58+
compilerVersion: 9.6.6
4459
setup-method: ghcup
4560
allow-failure: false
4661
- compiler: ghc-9.4.8
@@ -80,40 +95,74 @@ jobs:
8095
allow-failure: false
8196
fail-fast: false
8297
steps:
83-
- name: apt
98+
- name: apt-get install
8499
run: |
85100
apt-get update
86101
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
102+
- name: Install GHCup
103+
run: |
87104
mkdir -p "$HOME/.ghcup/bin"
88-
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
105+
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
89106
chmod a+x "$HOME/.ghcup/bin/ghcup"
107+
- name: Install cabal-install
108+
run: |
109+
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
110+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
111+
- name: Install GHC (GHCup)
112+
if: matrix.setup-method == 'ghcup'
113+
run: |
90114
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
91-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.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"
92121
env:
93122
HCKIND: ${{ matrix.compilerKind }}
94123
HCNAME: ${{ matrix.compiler }}
95124
HCVER: ${{ matrix.compilerVersion }}
96-
- name: Set PATH and environment variables
125+
- name: Install GHC (GHCup vanilla)
126+
if: matrix.setup-method == 'ghcup-vanilla'
97127
run: |
98-
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
99-
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
100-
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
101-
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
102-
HCDIR=/opt/$HCKIND/$HCVER
128+
"$HOME/.ghcup/bin/ghcup" -s https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.8.yaml install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
103129
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
104130
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
105131
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
106132
echo "HC=$HC" >> "$GITHUB_ENV"
107133
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
108134
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
109-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
135+
env:
136+
HCKIND: ${{ matrix.compilerKind }}
137+
HCNAME: ${{ matrix.compiler }}
138+
HCVER: ${{ matrix.compilerVersion }}
139+
- name: Install GHC (GHCup prerelease)
140+
if: matrix.setup-method == 'ghcup-prerelease'
141+
run: |
142+
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
143+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
144+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
145+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
146+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
147+
echo "HC=$HC" >> "$GITHUB_ENV"
148+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
149+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
150+
env:
151+
HCKIND: ${{ matrix.compilerKind }}
152+
HCNAME: ${{ matrix.compiler }}
153+
HCVER: ${{ matrix.compilerVersion }}
154+
- name: Set PATH and environment variables
155+
run: |
156+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
157+
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
158+
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
159+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
110160
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
111161
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
112162
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
113163
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
114-
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
164+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
115165
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
116-
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
117166
env:
118167
HCKIND: ${{ matrix.compilerKind }}
119168
HCNAME: ${{ matrix.compiler }}
@@ -140,6 +189,18 @@ jobs:
140189
repository hackage.haskell.org
141190
url: http://hackage.haskell.org/
142191
EOF
192+
if $HEADHACKAGE; then
193+
cat >> $CABAL_CONFIG <<EOF
194+
repository head.hackage.ghc.haskell.org
195+
url: https://ghc.gitlab.haskell.org/head.hackage/
196+
secure: True
197+
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
198+
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
199+
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
200+
key-threshold: 3
201+
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
202+
EOF
203+
fi
143204
cat >> $CABAL_CONFIG <<EOF
144205
program-default-options
145206
ghc-options: $GHCJOBS +RTS -M3G -RTS
@@ -165,8 +226,8 @@ jobs:
165226
- name: install cabal-docspec
166227
run: |
167228
mkdir -p $HOME/.cabal/bin
168-
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20240414/cabal-docspec-0.0.0.20240414-x86_64-linux.xz > cabal-docspec.xz
169-
echo '2d18a3f79619e8ec5f11870f926f6dc2616e02a6c889315b7f82044b95a1adb9 cabal-docspec.xz' | sha256sum -c -
229+
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20240703/cabal-docspec-0.0.0.20240703-x86_64-linux.xz > cabal-docspec.xz
230+
echo '48bf3b7fd2f7f0caa6162afee57a755be8523e7f467b694900eb420f5f9a7b76 cabal-docspec.xz' | sha256sum -c -
170231
xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec
171232
rm -f cabal-docspec.xz
172233
chmod a+x $HOME/.cabal/bin/cabal-docspec
@@ -200,6 +261,9 @@ jobs:
200261
echo " ghc-options: -Werror=missing-methods" >> cabal.project
201262
cat >> cabal.project <<EOF
202263
EOF
264+
if $HEADHACKAGE; then
265+
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
266+
fi
203267
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(text)$/; }' >> cabal.project.local
204268
cat cabal.project
205269
cat cabal.project.local
@@ -242,8 +306,8 @@ jobs:
242306
rm -f cabal.project.local
243307
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
244308
- name: save cache
245-
uses: actions/cache/save@v4
246309
if: always()
310+
uses: actions/cache/save@v4
247311
with:
248312
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
249313
path: ~/.cabal/store

text.cabal

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ tested-with:
5353
GHC == 9.0.2
5454
GHC == 9.2.8
5555
GHC == 9.4.8
56-
GHC == 9.6.4
56+
GHC == 9.6.6
5757
GHC == 9.8.2
5858
GHC == 9.10.1
59+
GHC == 9.12.1
5960

6061
extra-source-files:
6162
-- scripts/CaseFolding.txt

0 commit comments

Comments
 (0)