Skip to content

Commit 1fb0c15

Browse files
ci: test with currently recommended GHC versions
1 parent b158181 commit 1fb0c15

File tree

2 files changed

+40
-102
lines changed

2 files changed

+40
-102
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 39 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# This GitHub workflow config has been generated by a script via
22
#
3-
# haskell-ci '--hlint' '--hlint-job' '9.4.5' '--haddock' 'github' 'dyre.cabal'
3+
# haskell-ci 'github' 'dyre.cabal' '--haddock'
44
#
55
# To regenerate the script (for example after adjusting tested-with) run
66
#
77
# haskell-ci regenerate
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.16.1
11+
# version: 0.19.20250506
1212
#
13-
# REGENDATA ("0.16.1",["--hlint","--hlint-job","9.4.5","--haddock","github","dyre.cabal"])
13+
# REGENDATA ("0.19.20250506",["github","dyre.cabal","--haddock"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -19,86 +19,60 @@ 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.6.1
31+
- compiler: ghc-9.12.2
3232
compilerKind: ghc
33-
compilerVersion: 9.6.1
33+
compilerVersion: 9.12.2
3434
setup-method: ghcup
3535
allow-failure: false
36-
- compiler: ghc-9.4.5
36+
- compiler: ghc-9.10.2
3737
compilerKind: ghc
38-
compilerVersion: 9.4.5
38+
compilerVersion: 9.10.2
3939
setup-method: ghcup
4040
allow-failure: false
41-
- compiler: ghc-9.2.7
41+
- compiler: ghc-9.8.4
4242
compilerKind: ghc
43-
compilerVersion: 9.2.7
43+
compilerVersion: 9.8.4
4444
setup-method: ghcup
4545
allow-failure: false
46-
- compiler: ghc-9.0.2
46+
- compiler: ghc-9.6.7
4747
compilerKind: ghc
48-
compilerVersion: 9.0.2
48+
compilerVersion: 9.6.7
4949
setup-method: ghcup
5050
allow-failure: false
51-
- compiler: ghc-8.10.7
52-
compilerKind: ghc
53-
compilerVersion: 8.10.7
54-
setup-method: ghcup
55-
allow-failure: false
56-
- compiler: ghc-8.8.4
57-
compilerKind: ghc
58-
compilerVersion: 8.8.4
59-
setup-method: hvr-ppa
60-
allow-failure: false
61-
- compiler: ghc-8.6.5
62-
compilerKind: ghc
63-
compilerVersion: 8.6.5
64-
setup-method: hvr-ppa
65-
allow-failure: false
66-
- compiler: ghc-8.4.4
67-
compilerKind: ghc
68-
compilerVersion: 8.4.4
69-
setup-method: hvr-ppa
70-
allow-failure: false
71-
- compiler: ghc-8.2.2
72-
compilerKind: ghc
73-
compilerVersion: 8.2.2
74-
setup-method: hvr-ppa
75-
allow-failure: false
76-
- compiler: ghc-8.0.2
77-
compilerKind: ghc
78-
compilerVersion: 8.0.2
79-
setup-method: hvr-ppa
80-
allow-failure: false
8151
fail-fast: false
8252
steps:
83-
- name: apt
53+
- name: apt-get install
8454
run: |
8555
apt-get update
8656
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
87-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
88-
mkdir -p "$HOME/.ghcup/bin"
89-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
90-
chmod a+x "$HOME/.ghcup/bin/ghcup"
91-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
92-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
93-
else
94-
apt-add-repository -y 'ppa:hvr/ghc'
95-
apt-get update
96-
apt-get install -y "$HCNAME"
97-
mkdir -p "$HOME/.ghcup/bin"
98-
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
99-
chmod a+x "$HOME/.ghcup/bin/ghcup"
100-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
101-
fi
57+
- name: Install GHCup
58+
run: |
59+
mkdir -p "$HOME/.ghcup/bin"
60+
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
61+
chmod a+x "$HOME/.ghcup/bin/ghcup"
62+
- name: Install cabal-install
63+
run: |
64+
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
65+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
66+
- name: Install GHC (GHCup)
67+
if: matrix.setup-method == 'ghcup'
68+
run: |
69+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
70+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
71+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
72+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
73+
echo "HC=$HC" >> "$GITHUB_ENV"
74+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
75+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
10276
env:
10377
HCKIND: ${{ matrix.compilerKind }}
10478
HCNAME: ${{ matrix.compiler }}
@@ -109,28 +83,12 @@ jobs:
10983
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
11084
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
11185
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
112-
HCDIR=/opt/$HCKIND/$HCVER
113-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
114-
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
115-
echo "HC=$HC" >> "$GITHUB_ENV"
116-
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
117-
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
118-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
119-
else
120-
HC=$HCDIR/bin/$HCKIND
121-
echo "HC=$HC" >> "$GITHUB_ENV"
122-
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
123-
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
124-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
125-
fi
126-
12786
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
12887
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
12988
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
13089
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
13190
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
13291
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
133-
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
13492
env:
13593
HCKIND: ${{ matrix.compilerKind }}
13694
HCNAME: ${{ matrix.compiler }}
@@ -170,11 +128,6 @@ jobs:
170128
- name: update cabal index
171129
run: |
172130
$CABAL v2-update -v
173-
- name: cache (tools)
174-
uses: actions/cache/restore@v3
175-
with:
176-
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-6b1f90a1
177-
path: ~/.haskell-ci-tools
178131
- name: install cabal-plan
179132
run: |
180133
mkdir -p $HOME/.cabal/bin
@@ -184,20 +137,8 @@ jobs:
184137
rm -f cabal-plan.xz
185138
chmod a+x $HOME/.cabal/bin/cabal-plan
186139
cabal-plan --version
187-
- name: install hlint
188-
run: |
189-
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint --constraint='hlint >=3.5 && <3.6' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi
190-
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then if [ ! -e $HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint ]; then echo "Downloading HLint version $HLINTVER"; mkdir -p $HOME/.haskell-ci-tools; curl --write-out 'Status Code: %{http_code} Redirects: %{num_redirects} Total time: %{time_total} Total Dsize: %{size_download}\n' --silent --location --output $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz "https://github.com/ndmitchell/hlint/releases/download/v$HLINTVER/hlint-$HLINTVER-x86_64-linux.tar.gz"; tar -xzv -f $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz -C $HOME/.haskell-ci-tools; fi ; fi
191-
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then mkdir -p $CABAL_DIR/bin && ln -sf "$HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint" $CABAL_DIR/bin/hlint ; fi
192-
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then hlint --version ; fi
193-
- name: save cache (tools)
194-
uses: actions/cache/save@v3
195-
if: always()
196-
with:
197-
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-6b1f90a1
198-
path: ~/.haskell-ci-tools
199140
- name: checkout
200-
uses: actions/checkout@v3
141+
uses: actions/checkout@v4
201142
with:
202143
path: source
203144
- name: initial cabal.project for sdist
@@ -221,19 +162,19 @@ jobs:
221162
touch cabal.project
222163
touch cabal.project.local
223164
echo "packages: ${PKGDIR_dyre}" >> cabal.project
224-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package dyre" >> cabal.project ; fi
225-
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
165+
echo "package dyre" >> cabal.project
166+
echo " ghc-options: -Werror=missing-methods" >> cabal.project
226167
cat >> cabal.project <<EOF
227168
EOF
228-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(dyre)$/; }' >> cabal.project.local
169+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(dyre)$/; }' >> cabal.project.local
229170
cat cabal.project
230171
cat cabal.project.local
231172
- name: dump install plan
232173
run: |
233174
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
234175
cabal-plan
235176
- name: restore cache
236-
uses: actions/cache/restore@v3
177+
uses: actions/cache/restore@v4
237178
with:
238179
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
239180
path: ~/.cabal/store
@@ -251,9 +192,6 @@ jobs:
251192
- name: tests
252193
run: |
253194
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
254-
- name: hlint
255-
run: |
256-
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then (cd ${PKGDIR_dyre} && hlint -XHaskell2010 .) ; fi
257195
- name: cabal check
258196
run: |
259197
cd ${PKGDIR_dyre} || false
@@ -266,8 +204,8 @@ jobs:
266204
rm -f cabal.project.local
267205
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
268206
- name: save cache
269-
uses: actions/cache/save@v3
270207
if: always()
208+
uses: actions/cache/save@v4
271209
with:
272210
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
273211
path: ~/.cabal/store

dyre.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ license-file: LICENSE
2222

2323
build-type: Simple
2424
cabal-version: >= 1.10
25-
tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.7 || ==9.4.5 || ==9.6.1
25+
tested-with: GHC ==9.6.7 || ==9.8.4 || ==9.10.2 || ==9.12.2
2626

2727
extra-source-files:
2828
CHANGELOG.md

0 commit comments

Comments
 (0)