Skip to content

Commit 317e570

Browse files
committed
attempt to update test-with and github workflow
1 parent 66fdce2 commit 317e570

2 files changed

Lines changed: 92 additions & 72 deletions

File tree

.github/workflows/haskell-ci.yml

Lines changed: 91 additions & 71 deletions
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.18.1
11+
# version: 0.19.20250821
1212
#
13-
# REGENDATA ("0.18.1",["github","reform.cabal"])
13+
# REGENDATA ("0.19.20250821",["github","reform.cabal"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -19,33 +19,48 @@ on:
1919
jobs:
2020
linux:
2121
name: Haskell-CI - Linux - ${{ matrix.compiler }}
22-
runs-on: ubuntu-20.04
22+
runs-on: ubuntu-24.04
2323
timeout-minutes:
2424
60
2525
container:
26-
image: buildpack-deps:bionic
26+
image: buildpack-deps:jammy
2727
continue-on-error: ${{ matrix.allow-failure }}
2828
strategy:
2929
matrix:
3030
include:
31-
- compiler: ghc-9.8.2
31+
- compiler: ghc-9.14.0.20250819
3232
compilerKind: ghc
33-
compilerVersion: 9.8.2
33+
compilerVersion: 9.14.0.20250819
34+
setup-method: ghcup-prerelease
35+
allow-failure: false
36+
- compiler: ghc-9.12.2
37+
compilerKind: ghc
38+
compilerVersion: 9.12.2
39+
setup-method: ghcup
40+
allow-failure: false
41+
- compiler: ghc-9.10.2
42+
compilerKind: ghc
43+
compilerVersion: 9.10.2
3444
setup-method: ghcup
3545
allow-failure: false
36-
- compiler: ghc-9.6.4
46+
- compiler: ghc-9.8.4
3747
compilerKind: ghc
38-
compilerVersion: 9.6.4
48+
compilerVersion: 9.8.4
49+
setup-method: ghcup
50+
allow-failure: false
51+
- compiler: ghc-9.6.7
52+
compilerKind: ghc
53+
compilerVersion: 9.6.7
3954
setup-method: ghcup
4055
allow-failure: false
4156
- compiler: ghc-9.4.8
4257
compilerKind: ghc
4358
compilerVersion: 9.4.8
4459
setup-method: ghcup
4560
allow-failure: false
46-
- compiler: ghc-9.2.2
61+
- compiler: ghc-9.2.8
4762
compilerKind: ghc
48-
compilerVersion: 9.2.2
63+
compilerVersion: 9.2.8
4964
setup-method: ghcup
5065
allow-failure: false
5166
- compiler: ghc-9.0.2
@@ -61,64 +76,68 @@ jobs:
6176
- compiler: ghc-8.8.4
6277
compilerKind: ghc
6378
compilerVersion: 8.8.4
64-
setup-method: hvr-ppa
79+
setup-method: ghcup
6580
allow-failure: false
6681
- compiler: ghc-8.6.5
6782
compilerKind: ghc
6883
compilerVersion: 8.6.5
69-
setup-method: hvr-ppa
84+
setup-method: ghcup
7085
allow-failure: false
7186
- compiler: ghc-8.4.4
7287
compilerKind: ghc
7388
compilerVersion: 8.4.4
74-
setup-method: hvr-ppa
89+
setup-method: ghcup
7590
allow-failure: false
7691
- compiler: ghc-8.2.2
7792
compilerKind: ghc
7893
compilerVersion: 8.2.2
79-
setup-method: hvr-ppa
94+
setup-method: ghcup
8095
allow-failure: false
8196
- compiler: ghc-8.0.2
8297
compilerKind: ghc
8398
compilerVersion: 8.0.2
84-
setup-method: hvr-ppa
85-
allow-failure: false
86-
- compiler: ghc-7.10.3
87-
compilerKind: ghc
88-
compilerVersion: 7.10.3
89-
setup-method: hvr-ppa
90-
allow-failure: false
91-
- compiler: ghc-7.8.4
92-
compilerKind: ghc
93-
compilerVersion: 7.8.4
94-
setup-method: hvr-ppa
95-
allow-failure: false
96-
- compiler: ghc-7.6.3
97-
compilerKind: ghc
98-
compilerVersion: 7.6.3
99-
setup-method: hvr-ppa
99+
setup-method: ghcup
100100
allow-failure: false
101101
fail-fast: false
102102
steps:
103-
- name: apt
103+
- name: apt-get install
104104
run: |
105105
apt-get update
106-
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
107-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
108-
mkdir -p "$HOME/.ghcup/bin"
109-
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
110-
chmod a+x "$HOME/.ghcup/bin/ghcup"
111-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
112-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.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.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
119-
chmod a+x "$HOME/.ghcup/bin/ghcup"
120-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
121-
fi
106+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
107+
- name: Install GHCup
108+
run: |
109+
mkdir -p "$HOME/.ghcup/bin"
110+
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
111+
chmod a+x "$HOME/.ghcup/bin/ghcup"
112+
- name: Install cabal-install
113+
run: |
114+
"$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
115+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
116+
- name: Install GHC (GHCup)
117+
if: matrix.setup-method == 'ghcup'
118+
run: |
119+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
120+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
121+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
122+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
123+
echo "HC=$HC" >> "$GITHUB_ENV"
124+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
125+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
126+
env:
127+
HCKIND: ${{ matrix.compilerKind }}
128+
HCNAME: ${{ matrix.compiler }}
129+
HCVER: ${{ matrix.compilerVersion }}
130+
- name: Install GHC (GHCup prerelease)
131+
if: matrix.setup-method == 'ghcup-prerelease'
132+
run: |
133+
"$HOME/.ghcup/bin/ghcup" config add-release-channel prereleases
134+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
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"
122141
env:
123142
HCKIND: ${{ matrix.compilerKind }}
124143
HCNAME: ${{ matrix.compiler }}
@@ -129,30 +148,12 @@ jobs:
129148
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
130149
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
131150
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
132-
HCDIR=/opt/$HCKIND/$HCVER
133-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
134-
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
135-
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
136-
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
137-
echo "HC=$HC" >> "$GITHUB_ENV"
138-
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
139-
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
140-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
141-
else
142-
HC=$HCDIR/bin/$HCKIND
143-
echo "HC=$HC" >> "$GITHUB_ENV"
144-
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
145-
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
146-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
147-
fi
148-
149151
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
150152
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
151153
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
152154
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
153-
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
155+
if [ $((HCNUMVER >= 91400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
154156
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
155-
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
156157
env:
157158
HCKIND: ${{ matrix.compilerKind }}
158159
HCNAME: ${{ matrix.compiler }}
@@ -179,6 +180,18 @@ jobs:
179180
repository hackage.haskell.org
180181
url: http://hackage.haskell.org/
181182
EOF
183+
if $HEADHACKAGE; then
184+
cat >> $CABAL_CONFIG <<EOF
185+
repository head.hackage.ghc.haskell.org
186+
url: https://ghc.gitlab.haskell.org/head.hackage/
187+
secure: True
188+
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
189+
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
190+
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
191+
key-threshold: 3
192+
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
193+
EOF
194+
fi
182195
cat >> $CABAL_CONFIG <<EOF
183196
program-default-options
184197
ghc-options: $GHCJOBS +RTS -M3G -RTS
@@ -202,7 +215,7 @@ jobs:
202215
chmod a+x $HOME/.cabal/bin/cabal-plan
203216
cabal-plan --version
204217
- name: checkout
205-
uses: actions/checkout@v3
218+
uses: actions/checkout@v4
206219
with:
207220
path: source
208221
- name: initial cabal.project for sdist
@@ -227,18 +240,25 @@ jobs:
227240
touch cabal.project.local
228241
echo "packages: ${PKGDIR_reform}" >> cabal.project
229242
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package reform" >> cabal.project ; fi
230-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
243+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project ; fi
244+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package reform" >> cabal.project ; fi
245+
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
246+
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package reform" >> cabal.project ; fi
247+
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
231248
cat >> cabal.project <<EOF
232249
EOF
233-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(reform)$/; }' >> cabal.project.local
250+
if $HEADHACKAGE; then
251+
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
252+
fi
253+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(reform)$/; }' >> cabal.project.local
234254
cat cabal.project
235255
cat cabal.project.local
236256
- name: dump install plan
237257
run: |
238258
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
239259
cabal-plan
240260
- name: restore cache
241-
uses: actions/cache/restore@v3
261+
uses: actions/cache/restore@v4
242262
with:
243263
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
244264
path: ~/.cabal/store
@@ -265,8 +285,8 @@ jobs:
265285
rm -f cabal.project.local
266286
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
267287
- name: save cache
268-
uses: actions/cache/save@v3
269288
if: always()
289+
uses: actions/cache/save@v4
270290
with:
271291
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
272292
path: ~/.cabal/store

reform.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Category: Web
1414
Build-type: Simple
1515
Homepage: http://www.happstack.com/
1616
Cabal-version: >=1.10
17-
tested-with: GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.2, GHC == 9.4.8, GHC == 9.6.4, GHC == 9.8.2
17+
tested-with: GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC == 9.2.8, GHC == 9.4.8, GHC == 9.6.7, GHC == 9.8.4, GHC == 9.10.2, GHC == 9.12.2, GHC == 9.14.1
1818

1919
source-repository head
2020
type: git

0 commit comments

Comments
 (0)