Skip to content

Commit c900651

Browse files
committed
CI: Add ghc 9.12 to the build matrix
1 parent 7110516 commit c900651

File tree

2 files changed

+83
-31
lines changed

2 files changed

+83
-31
lines changed

.github/workflows/haskell-ci.yml

+78-28
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.17.20231010
11+
# version: 0.19.20241202
1212
#
13-
# REGENDATA ("0.17.20231010",["github","cabal.project"])
13+
# REGENDATA ("0.19.20241202",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -27,24 +27,39 @@ jobs:
2727
timeout-minutes:
2828
60
2929
container:
30-
image: buildpack-deps:bionic
30+
image: buildpack-deps:jammy
3131
continue-on-error: ${{ matrix.allow-failure }}
3232
strategy:
3333
matrix:
3434
include:
35-
- compiler: ghc-9.8.1
35+
- compiler: ghc-9.12.0.20241128
3636
compilerKind: ghc
37-
compilerVersion: 9.8.1
37+
compilerVersion: 9.12.0.20241128
3838
setup-method: ghcup
3939
allow-failure: false
40-
- compiler: ghc-9.6.3
40+
- compiler: ghc-9.12.0.20241128
4141
compilerKind: ghc
42-
compilerVersion: 9.6.3
42+
compilerVersion: 9.12.0.20241128
43+
setup-method: ghcup-prerelease
44+
allow-failure: false
45+
- compiler: ghc-9.10.1
46+
compilerKind: ghc
47+
compilerVersion: 9.10.1
48+
setup-method: ghcup
49+
allow-failure: false
50+
- compiler: ghc-9.8.4
51+
compilerKind: ghc
52+
compilerVersion: 9.8.4
4353
setup-method: ghcup
4454
allow-failure: false
45-
- compiler: ghc-9.4.7
55+
- compiler: ghc-9.6.6
4656
compilerKind: ghc
47-
compilerVersion: 9.4.7
57+
compilerVersion: 9.6.6
58+
setup-method: ghcup
59+
allow-failure: false
60+
- compiler: ghc-9.4.8
61+
compilerKind: ghc
62+
compilerVersion: 9.4.8
4863
setup-method: ghcup
4964
allow-failure: false
5065
- compiler: ghc-9.2.8
@@ -84,40 +99,60 @@ jobs:
8499
allow-failure: false
85100
fail-fast: false
86101
steps:
87-
- name: apt
102+
- name: apt-get install
88103
run: |
89104
apt-get update
90105
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
106+
- name: Install GHCup
107+
run: |
91108
mkdir -p "$HOME/.ghcup/bin"
92-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
109+
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
93110
chmod a+x "$HOME/.ghcup/bin/ghcup"
111+
- name: Install cabal-install
112+
run: |
113+
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
114+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
115+
- name: Install GHC (GHCup)
116+
if: matrix.setup-method == 'ghcup'
117+
run: |
94118
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
95-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
119+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
120+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
121+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
122+
echo "HC=$HC" >> "$GITHUB_ENV"
123+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
124+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
96125
env:
97126
HCKIND: ${{ matrix.compilerKind }}
98127
HCNAME: ${{ matrix.compiler }}
99128
HCVER: ${{ matrix.compilerVersion }}
100-
- name: Set PATH and environment variables
129+
- name: Install GHC (GHCup prerelease)
130+
if: matrix.setup-method == 'ghcup-prerelease'
101131
run: |
102-
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
103-
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
104-
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
105-
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
106-
HCDIR=/opt/$HCKIND/$HCVER
132+
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
133+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
107134
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
108135
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
109136
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
110137
echo "HC=$HC" >> "$GITHUB_ENV"
111138
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
112139
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
113-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
140+
env:
141+
HCKIND: ${{ matrix.compilerKind }}
142+
HCNAME: ${{ matrix.compiler }}
143+
HCVER: ${{ matrix.compilerVersion }}
144+
- name: Set PATH and environment variables
145+
run: |
146+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
147+
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
148+
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
149+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
114150
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
115151
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
116152
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
117153
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
118-
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
154+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
119155
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
120-
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
121156
env:
122157
HCKIND: ${{ matrix.compilerKind }}
123158
HCNAME: ${{ matrix.compiler }}
@@ -144,6 +179,18 @@ jobs:
144179
repository hackage.haskell.org
145180
url: http://hackage.haskell.org/
146181
EOF
182+
if $HEADHACKAGE; then
183+
cat >> $CABAL_CONFIG <<EOF
184+
repository head.hackage.ghc.haskell.org
185+
url: https://ghc.gitlab.haskell.org/head.hackage/
186+
secure: True
187+
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
188+
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
189+
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
190+
key-threshold: 3
191+
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
192+
EOF
193+
fi
147194
cat >> $CABAL_CONFIG <<EOF
148195
program-default-options
149196
ghc-options: $GHCJOBS +RTS -M3G -RTS
@@ -167,7 +214,7 @@ jobs:
167214
chmod a+x $HOME/.cabal/bin/cabal-plan
168215
cabal-plan --version
169216
- name: checkout
170-
uses: actions/checkout@v3
217+
uses: actions/checkout@v4
171218
with:
172219
path: source
173220
- name: initial cabal.project for sdist
@@ -194,19 +241,22 @@ jobs:
194241
echo "package unordered-containers" >> cabal.project
195242
echo " ghc-options: -Werror=missing-methods" >> cabal.project
196243
cat >> cabal.project <<EOF
197-
allow-newer: nothunks:bytestring
198-
allow-newer: nothunks:text
199-
allow-newer: ChasingBottoms:base
244+
allow-newer: hashable:base
245+
allow-newer: splitmix:base
246+
allow-newer: vector-stream:ghc-prim
200247
EOF
201-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(binary|containers|unordered-containers)$/; }' >> cabal.project.local
248+
if $HEADHACKAGE; then
249+
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
250+
fi
251+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(binary|containers|unordered-containers)$/; }' >> cabal.project.local
202252
cat cabal.project
203253
cat cabal.project.local
204254
- name: dump install plan
205255
run: |
206256
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
207257
cabal-plan
208258
- name: restore cache
209-
uses: actions/cache/restore@v3
259+
uses: actions/cache/restore@v4
210260
with:
211261
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
212262
path: ~/.cabal/store
@@ -246,8 +296,8 @@ jobs:
246296
$CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='unordered-containers +debug' all
247297
$CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='unordered-containers +debug' all
248298
- name: save cache
249-
uses: actions/cache/save@v3
250299
if: always()
300+
uses: actions/cache/save@v4
251301
with:
252302
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
253303
path: ~/.cabal/store

unordered-containers.cabal

+5-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ cabal-version: >=1.10
2929
extra-source-files: CHANGES.md
3030

3131
tested-with:
32-
GHC ==9.8.1
33-
|| ==9.6.3
34-
|| ==9.4.7
32+
GHC ==9.12.1
33+
|| ==9.10.1
34+
|| ==9.8.4
35+
|| ==9.6.6
36+
|| ==9.4.8
3537
|| ==9.2.8
3638
|| ==9.0.2
3739
|| ==8.10.7

0 commit comments

Comments
 (0)