Skip to content

Commit 44287d8

Browse files
committed
CI: Add ghc 9.12 to the build matrix
1 parent 3bd64fa commit 44287d8

File tree

1 file changed

+50
-55
lines changed

1 file changed

+50
-55
lines changed

.github/workflows/haskell-ci.yml

+50-55
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/andreasabel/haskell-ci
1010
#
11-
# version: 0.17.20231010
11+
# version: 0.19.20241021
1212
#
13-
# REGENDATA ("0.17.20231010",["github","vector-algorithms.cabal"])
13+
# REGENDATA ("0.19.20241021",["github","vector-algorithms.cabal"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -27,11 +27,16 @@ jobs:
2727
timeout-minutes:
2828
60
2929
container:
30-
image: buildpack-deps:focal
30+
image: buildpack-deps:jammy
3131
continue-on-error: ${{ matrix.allow-failure }}
3232
strategy:
3333
matrix:
3434
include:
35+
- compiler: ghc-9.12.20241014
36+
compilerKind: ghc
37+
compilerVersion: 9.12.20241014
38+
setup-method: ghcup
39+
allow-failure: false
3540
- compiler: ghc-9.10.1
3641
compilerKind: ghc
3742
compilerVersion: 9.10.1
@@ -42,9 +47,9 @@ jobs:
4247
compilerVersion: 9.8.2
4348
setup-method: ghcup
4449
allow-failure: false
45-
- compiler: ghc-9.6.5
50+
- compiler: ghc-9.6.3
4651
compilerKind: ghc
47-
compilerVersion: 9.6.5
52+
compilerVersion: 9.6.3
4853
setup-method: ghcup
4954
allow-failure: false
5055
- compiler: ghc-9.4.7
@@ -70,56 +75,40 @@ jobs:
7075
- compiler: ghc-8.8.4
7176
compilerKind: ghc
7277
compilerVersion: 8.8.4
73-
setup-method: hvr-ppa
78+
setup-method: ghcup
7479
allow-failure: false
7580
- compiler: ghc-8.6.5
7681
compilerKind: ghc
7782
compilerVersion: 8.6.5
78-
setup-method: hvr-ppa
83+
setup-method: ghcup
7984
allow-failure: false
8085
- compiler: ghc-8.4.4
8186
compilerKind: ghc
8287
compilerVersion: 8.4.4
83-
setup-method: hvr-ppa
88+
setup-method: ghcup
8489
allow-failure: false
8590
- compiler: ghc-8.2.2
8691
compilerKind: ghc
8792
compilerVersion: 8.2.2
88-
setup-method: hvr-ppa
93+
setup-method: ghcup
8994
allow-failure: false
9095
- compiler: ghc-8.0.2
9196
compilerKind: ghc
9297
compilerVersion: 8.0.2
93-
setup-method: hvr-ppa
94-
allow-failure: false
95-
- compiler: ghc-7.10.3
96-
compilerKind: ghc
97-
compilerVersion: 7.10.3
98-
setup-method: hvr-ppa
98+
setup-method: ghcup
9999
allow-failure: false
100100
fail-fast: false
101101
steps:
102102
- name: apt
103103
run: |
104104
apt-get update
105-
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
106-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
107-
mkdir -p "$HOME/.ghcup/bin"
108-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
109-
chmod a+x "$HOME/.ghcup/bin/ghcup"
110-
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
111-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
112-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
113-
else
114-
apt-add-repository -y 'ppa:hvr/ghc'
115-
apt-get update
116-
apt-get install -y "$HCNAME"
117-
mkdir -p "$HOME/.ghcup/bin"
118-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup"
119-
chmod a+x "$HOME/.ghcup/bin/ghcup"
120-
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;
121-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
122-
fi
105+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
106+
mkdir -p "$HOME/.ghcup/bin"
107+
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
108+
chmod a+x "$HOME/.ghcup/bin/ghcup"
109+
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
110+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
111+
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
123112
env:
124113
HCKIND: ${{ matrix.compilerKind }}
125114
HCNAME: ${{ matrix.compiler }}
@@ -131,27 +120,18 @@ jobs:
131120
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
132121
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
133122
HCDIR=/opt/$HCKIND/$HCVER
134-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
135-
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
136-
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
137-
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
138-
echo "HC=$HC" >> "$GITHUB_ENV"
139-
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
140-
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
141-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
142-
else
143-
HC=$HCDIR/bin/$HCKIND
144-
echo "HC=$HC" >> "$GITHUB_ENV"
145-
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
146-
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
147-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
148-
fi
149-
123+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
124+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
125+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
126+
echo "HC=$HC" >> "$GITHUB_ENV"
127+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
128+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
129+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
150130
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
151131
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
152-
if [ $((HCNUMVER >= 80000)) -ne 0 ] ; then echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" ; else echo "ARG_TESTS=--disable-tests" >> "$GITHUB_ENV" ; fi
132+
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
153133
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
154-
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
134+
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
155135
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
156136
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
157137
env:
@@ -180,6 +160,18 @@ jobs:
180160
repository hackage.haskell.org
181161
url: http://hackage.haskell.org/
182162
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
183175
cat >> $CABAL_CONFIG <<EOF
184176
program-default-options
185177
ghc-options: $GHCJOBS +RTS -M3G -RTS
@@ -231,15 +223,18 @@ jobs:
231223
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
232224
cat >> cabal.project <<EOF
233225
EOF
234-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(vector-algorithms)$/; }' >> cabal.project.local
226+
if $HEADHACKAGE; then
227+
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
228+
fi
229+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(vector-algorithms)$/; }' >> cabal.project.local
235230
cat cabal.project
236231
cat cabal.project.local
237232
- name: dump install plan
238233
run: |
239234
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
240235
cabal-plan
241236
- name: restore cache
242-
uses: actions/cache/restore@v3
237+
uses: actions/cache/restore@v4
243238
with:
244239
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
245240
path: ~/.cabal/store
@@ -256,7 +251,7 @@ jobs:
256251
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
257252
- name: tests
258253
run: |
259-
if [ $((HCNUMVER >= 80000)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct ; fi
254+
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
260255
- name: cabal check
261256
run: |
262257
cd ${PKGDIR_vector_algorithms} || false
@@ -269,7 +264,7 @@ jobs:
269264
rm -f cabal.project.local
270265
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
271266
- name: save cache
272-
uses: actions/cache/save@v3
267+
uses: actions/cache/save@v4
273268
if: always()
274269
with:
275270
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}

0 commit comments

Comments
 (0)