Skip to content

Commit 59b90df

Browse files
authored
Merge pull request #58 from TeofilC/wip/ghc-9.12
Support GHC-9.10 and GHC-9.12
2 parents 10c45b4 + a73d6c3 commit 59b90df

File tree

3 files changed

+50
-50
lines changed

3 files changed

+50
-50
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 40 additions & 44 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 'github' 'cabal.project' '--config' 'cabal.haskell-ci'
3+
# haskell-ci 'github' 'cabal.project'
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.17.20231110
11+
# version: 0.19.20250506
1212
#
13-
# REGENDATA ("0.17.20231110",["github","cabal.project","--config","cabal.haskell-ci"])
13+
# REGENDATA ("0.19.20250506",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -23,7 +23,7 @@ on:
2323
jobs:
2424
linux:
2525
name: Haskell-CI - Linux - ${{ matrix.compiler }}
26-
runs-on: ubuntu-20.04
26+
runs-on: ubuntu-24.04
2727
timeout-minutes:
2828
60
2929
container:
@@ -32,6 +32,16 @@ jobs:
3232
strategy:
3333
matrix:
3434
include:
35+
- compiler: ghc-9.12.1
36+
compilerKind: ghc
37+
compilerVersion: 9.12.1
38+
setup-method: ghcup
39+
allow-failure: false
40+
- compiler: ghc-9.10.2
41+
compilerKind: ghc
42+
compilerVersion: 9.10.2
43+
setup-method: ghcup
44+
allow-failure: false
3545
- compiler: ghc-9.8.1
3646
compilerKind: ghc
3747
compilerVersion: 9.8.1
@@ -65,34 +75,38 @@ jobs:
6575
- compiler: ghc-8.8.4
6676
compilerKind: ghc
6777
compilerVersion: 8.8.4
68-
setup-method: hvr-ppa
78+
setup-method: ghcup
6979
allow-failure: false
7080
- compiler: ghc-8.6.5
7181
compilerKind: ghc
7282
compilerVersion: 8.6.5
73-
setup-method: hvr-ppa
83+
setup-method: ghcup
7484
allow-failure: false
7585
fail-fast: false
7686
steps:
77-
- name: apt
87+
- name: apt-get install
7888
run: |
7989
apt-get update
8090
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
81-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
82-
mkdir -p "$HOME/.ghcup/bin"
83-
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
84-
chmod a+x "$HOME/.ghcup/bin/ghcup"
85-
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
86-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
87-
else
88-
apt-add-repository -y 'ppa:hvr/ghc'
89-
apt-get update
90-
apt-get install -y "$HCNAME"
91-
mkdir -p "$HOME/.ghcup/bin"
92-
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
93-
chmod a+x "$HOME/.ghcup/bin/ghcup"
94-
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
95-
fi
91+
- name: Install GHCup
92+
run: |
93+
mkdir -p "$HOME/.ghcup/bin"
94+
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
95+
chmod a+x "$HOME/.ghcup/bin/ghcup"
96+
- name: Install cabal-install
97+
run: |
98+
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
99+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
100+
- name: Install GHC (GHCup)
101+
if: matrix.setup-method == 'ghcup'
102+
run: |
103+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
104+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
105+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
106+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
107+
echo "HC=$HC" >> "$GITHUB_ENV"
108+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
109+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
96110
env:
97111
HCKIND: ${{ matrix.compilerKind }}
98112
HCNAME: ${{ matrix.compiler }}
@@ -103,30 +117,12 @@ jobs:
103117
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
104118
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
105119
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
106-
HCDIR=/opt/$HCKIND/$HCVER
107-
if [ "${{ matrix.setup-method }}" = ghcup ]; then
108-
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
109-
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
110-
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
111-
echo "HC=$HC" >> "$GITHUB_ENV"
112-
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
113-
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
114-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
115-
else
116-
HC=$HCDIR/bin/$HCKIND
117-
echo "HC=$HC" >> "$GITHUB_ENV"
118-
echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
119-
echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
120-
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
121-
fi
122-
123120
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
124121
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
125122
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
126123
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
127124
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
128125
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
129-
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
130126
env:
131127
HCKIND: ${{ matrix.compilerKind }}
132128
HCNAME: ${{ matrix.compiler }}
@@ -176,7 +172,7 @@ jobs:
176172
chmod a+x $HOME/.cabal/bin/cabal-plan
177173
cabal-plan --version
178174
- name: checkout
179-
uses: actions/checkout@v3
175+
uses: actions/checkout@v4
180176
with:
181177
path: source
182178
- name: initial cabal.project for sdist
@@ -210,15 +206,15 @@ jobs:
210206
echo " ghc-options: -Werror=missing-methods" >> cabal.project
211207
cat >> cabal.project <<EOF
212208
EOF
213-
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(example|servant-openapi3)$/; }' >> cabal.project.local
209+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(example|servant-openapi3)$/; }' >> cabal.project.local
214210
cat cabal.project
215211
cat cabal.project.local
216212
- name: dump install plan
217213
run: |
218214
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
219215
cabal-plan
220216
- name: restore cache
221-
uses: actions/cache/restore@v3
217+
uses: actions/cache/restore@v4
222218
with:
223219
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
224220
path: ~/.cabal/store
@@ -289,8 +285,8 @@ jobs:
289285
if [ $((HCNUMVER < 81000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.17.*' --dependencies-only -j2 all ; fi
290286
if [ $((HCNUMVER < 81000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='servant ==0.17.*' all ; fi
291287
- name: save cache
292-
uses: actions/cache/save@v3
293288
if: always()
289+
uses: actions/cache/save@v4
294290
with:
295291
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
296292
path: ~/.cabal/store

example/example.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ tested-with:
2222
|| ==9.4.8
2323
|| ==9.6.3
2424
|| ==9.8.1
25+
|| ==9.10.2
26+
|| ==9.12.1
2527

2628
library
2729
ghc-options: -Wall

servant-openapi3.cabal

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ tested-with:
3737
|| ==9.4.8
3838
|| ==9.6.3
3939
|| ==9.8.1
40+
|| ==9.10.2
41+
|| ==9.12.1
4042

4143
extra-source-files:
4244
README.md
@@ -57,7 +59,7 @@ source-repository head
5759

5860
custom-setup
5961
setup-depends:
60-
base >=4.9 && <4.20,
62+
base >=4.9 && <4.22,
6163
Cabal >= 1.24 && < 4,
6264
cabal-doctest >=1.0.6 && <1.1
6365

@@ -79,8 +81,8 @@ library
7981
hs-source-dirs: src
8082
build-depends: aeson >=1.4.2.0 && <1.6 || >=2.0.1.0 && <2.3
8183
, aeson-pretty >=0.8.7 && <0.9
82-
, base >=4.9.1.0 && <4.20
83-
, base-compat >=0.10.5 && <0.14
84+
, base >=4.9.1.0 && <4.22
85+
, base-compat >=0.10.5 && <0.15
8486
, bytestring >=0.10.8.1 && <0.13
8587
, http-media >=0.7.1.3 && <0.9
8688
, insert-ordered-containers >=0.2.1.0 && <0.3
@@ -98,9 +100,9 @@ library
98100
test-suite doctests
99101
ghc-options: -Wall
100102
build-depends:
101-
base,
103+
base <5,
102104
directory >= 1.0,
103-
doctest >= 0.11.1 && <0.23,
105+
doctest >= 0.11.1 && <0.25,
104106
servant,
105107
QuickCheck,
106108
filepath
@@ -115,7 +117,7 @@ test-suite spec
115117
hs-source-dirs: test
116118
main-is: Spec.hs
117119
build-tool-depends: hspec-discover:hspec-discover >=2.6.0 && <2.12
118-
build-depends: base
120+
build-depends: base <5
119121
, base-compat
120122
, aeson
121123
, hspec >=2.6.0 && <2.12

0 commit comments

Comments
 (0)