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","--config=cabal.haskell-ci","cabal.project"])
13+ # REGENDATA ("0.19.20250821 ",["github","--config=cabal.haskell-ci","cabal.project"])
1414#
1515name : Haskell-CI
1616on :
2323jobs :
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 :
30- image : buildpack-deps:bionic
30+ image : buildpack-deps:jammy
3131 services :
3232 postgres :
3333 image : postgres:14
@@ -38,14 +38,29 @@ jobs:
3838 strategy :
3939 matrix :
4040 include :
41- - compiler : ghc-9.8.2
41+ - compiler : ghc-9.14.0.20250819
4242 compilerKind : ghc
43- compilerVersion : 9.8.2
43+ compilerVersion : 9.14.0.20250819
44+ setup-method : ghcup-prerelease
45+ allow-failure : false
46+ - compiler : ghc-9.12.2
47+ compilerKind : ghc
48+ compilerVersion : 9.12.2
49+ setup-method : ghcup
50+ allow-failure : false
51+ - compiler : ghc-9.10.2
52+ compilerKind : ghc
53+ compilerVersion : 9.10.2
4454 setup-method : ghcup
4555 allow-failure : false
46- - compiler : ghc-9.6 .4
56+ - compiler : ghc-9.8 .4
4757 compilerKind : ghc
48- compilerVersion : 9.6.4
58+ compilerVersion : 9.8.4
59+ setup-method : ghcup
60+ allow-failure : false
61+ - compiler : ghc-9.6.7
62+ compilerKind : ghc
63+ compilerVersion : 9.6.7
4964 setup-method : ghcup
5065 allow-failure : false
5166 - compiler : ghc-9.4.8
@@ -70,40 +85,60 @@ jobs:
7085 allow-failure : false
7186 fail-fast : false
7287 steps :
73- - name : apt
88+ - name : apt-get install
7489 run : |
7590 apt-get update
7691 apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
92+ - name : Install GHCup
93+ run : |
7794 mkdir -p "$HOME/.ghcup/bin"
78- curl -sL https://downloads.haskell.org/ghcup/0.1.20.0 /x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
95+ curl -sL https://downloads.haskell.org/ghcup/0.1.50.1 /x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
7996 chmod a+x "$HOME/.ghcup/bin/ghcup"
97+ - name : Install cabal-install
98+ run : |
99+ "$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
100+ echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
101+ - name : Install GHC (GHCup)
102+ if : matrix.setup-method == 'ghcup'
103+ run : |
80104 "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
81- "$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
105+ HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
106+ HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
107+ HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
108+ echo "HC=$HC" >> "$GITHUB_ENV"
109+ echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
110+ echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
82111 env :
83112 HCKIND : ${{ matrix.compilerKind }}
84113 HCNAME : ${{ matrix.compiler }}
85114 HCVER : ${{ matrix.compilerVersion }}
86- - name : Set PATH and environment variables
115+ - name : Install GHC (GHCup prerelease)
116+ if : matrix.setup-method == 'ghcup-prerelease'
87117 run : |
88- echo "$HOME/.cabal/bin" >> $GITHUB_PATH
89- echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
90- echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
91- echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
92- HCDIR=/opt/$HCKIND/$HCVER
118+ "$HOME/.ghcup/bin/ghcup" config add-release-channel prereleases
119+ "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
93120 HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
94121 HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
95122 HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
96123 echo "HC=$HC" >> "$GITHUB_ENV"
97124 echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
98125 echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
99- echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
126+ env :
127+ HCKIND : ${{ matrix.compilerKind }}
128+ HCNAME : ${{ matrix.compiler }}
129+ HCVER : ${{ matrix.compilerVersion }}
130+ - name : Set PATH and environment variables
131+ run : |
132+ echo "$HOME/.cabal/bin" >> $GITHUB_PATH
133+ echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
134+ echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
135+ echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
100136 HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
101137 echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
102138 echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
103139 echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
104- echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
140+ if [ $((HCNUMVER >= 91400)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE= false" >> "$GITHUB_ENV" ; fi
105141 echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
106- echo "GHCJSARITH=0" >> "$GITHUB_ENV"
107142 env :
108143 HCKIND : ${{ matrix.compilerKind }}
109144 HCNAME : ${{ matrix.compiler }}
@@ -130,6 +165,18 @@ jobs:
130165 repository hackage.haskell.org
131166 url: http://hackage.haskell.org/
132167 EOF
168+ if $HEADHACKAGE; then
169+ cat >> $CABAL_CONFIG <<EOF
170+ repository head.hackage.ghc.haskell.org
171+ url: https://ghc.gitlab.haskell.org/head.hackage/
172+ secure: True
173+ root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
174+ 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
175+ f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
176+ key-threshold: 3
177+ active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
178+ EOF
179+ fi
133180 cat >> $CABAL_CONFIG <<EOF
134181 program-default-options
135182 ghc-options: $GHCJOBS +RTS -M3G -RTS
@@ -144,9 +191,9 @@ jobs:
144191 run : |
145192 $CABAL v2-update -v
146193 - name : cache (tools)
147- uses : actions/cache/restore@v3
194+ uses : actions/cache/restore@v4
148195 with :
149- key : ${{ runner.os }}-${{ matrix.compiler }}-tools-9b3acae5
196+ key : ${{ runner.os }}-${{ matrix.compiler }}-tools-e93c7dce
150197 path : ~/.haskell-ci-tools
151198 - name : install cabal-plan
152199 run : |
@@ -159,16 +206,16 @@ jobs:
159206 cabal-plan --version
160207 - name : install doctest
161208 run : |
162- $ CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.22'
163- doctest --version
209+ if [ $((HCNUMVER < 91000)) -ne 0 ] ; then $ CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.22.0' ; fi
210+ if [ $((HCNUMVER < 91000)) -ne 0 ] ; then doctest --version ; fi
164211 - name : save cache (tools)
165- uses : actions/cache/save@v3
166212 if : always()
213+ uses : actions/cache/save@v4
167214 with :
168- key : ${{ runner.os }}-${{ matrix.compiler }}-tools-9b3acae5
215+ key : ${{ runner.os }}-${{ matrix.compiler }}-tools-e93c7dce
169216 path : ~/.haskell-ci-tools
170217 - name : checkout
171- uses : actions/checkout@v3
218+ uses : actions/checkout@v4
172219 with :
173220 path : source
174221 - name : initial cabal.project for sdist
@@ -193,18 +240,29 @@ jobs:
193240 touch cabal.project.local
194241 echo "packages: ${PKGDIR_hpqtypes_effectful}" >> cabal.project
195242 echo "package hpqtypes-effectful" >> cabal.project
196- echo " ghc-options: -Werror=missing-methods" >> cabal.project
243+ echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
244+ if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package hpqtypes-effectful" >> 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 hpqtypes-effectful" >> cabal.project ; fi
247+ if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
197248 cat >> cabal.project <<EOF
249+ source-repository-package
250+ type: git
251+ location: https://github.com/scrive/hpqtypes
252+ tag: be22e3fe676390f50fba007a07691d34be7ff551
198253 EOF
199- $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(hpqtypes-effectful)$/; }' >> cabal.project.local
254+ if $HEADHACKAGE; then
255+ echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
256+ fi
257+ $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(hpqtypes-effectful)$/; }' >> cabal.project.local
200258 cat cabal.project
201259 cat cabal.project.local
202260 - name : dump install plan
203261 run : |
204262 $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
205263 cabal-plan
206264 - name : restore cache
207- uses : actions/cache/restore@v3
265+ uses : actions/cache/restore@v4
208266 with :
209267 key : ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
210268 path : ~/.cabal/store
@@ -224,8 +282,8 @@ jobs:
224282 $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
225283 - name : doctest
226284 run : |
227- cd ${PKGDIR_hpqtypes_effectful} || false
228- doctest -XHaskell2010 -XBangPatterns -XConstraintKinds -XDataKinds -XDeriveFunctor -XDeriveGeneric -XDerivingStrategies -XFlexibleContexts -XFlexibleInstances -XGADTs -XGeneralizedNewtypeDeriving -XLambdaCase -XMultiParamTypeClasses -XNoStarIsType -XRankNTypes -XRoleAnnotations -XScopedTypeVariables -XStandaloneDeriving -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators src
285+ if [ $((HCNUMVER < 91000)) -ne 0 ] ; then cd ${PKGDIR_hpqtypes_effectful} || false ; fi
286+ if [ $((HCNUMVER < 91000)) -ne 0 ] ; then doctest -XHaskell2010 -XBangPatterns -XConstraintKinds -XDataKinds -XDeriveFunctor -XDeriveGeneric -XDerivingStrategies -XFlexibleContexts -XFlexibleInstances -XImportQualifiedPost - XGADTs -XGeneralizedNewtypeDeriving -XLambdaCase -XMultiParamTypeClasses -XNoStarIsType -XRankNTypes -XRoleAnnotations -XScopedTypeVariables -XStandaloneDeriving -XTupleSections -XTypeApplications -XTypeFamilies -XTypeOperators -XUndecidableInstances src ; fi
229287 - name : cabal check
230288 run : |
231289 cd ${PKGDIR_hpqtypes_effectful} || false
@@ -238,8 +296,8 @@ jobs:
238296 rm -f cabal.project.local
239297 $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
240298 - name : save cache
241- uses : actions/cache/save@v3
242299 if : always()
300+ uses : actions/cache/save@v4
243301 with :
244302 key : ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
245303 path : ~/.cabal/store
0 commit comments