@@ -8,9 +8,9 @@
88#
99# For more information, see https://github.com/haskell-CI/haskell-ci
1010#
11−# version: 0.11.20210214
11+# version: 0.19.20241223
1212#
13−# REGENDATA ("0.11.20210214",["github","cabal.project"])
13+# REGENDATA ("0.19.20241223",["github","cabal.project"])
1414#
1515name: Haskell-CI
1616on:
@@ -22,65 +22,111 @@ on:
2222 - master
2323jobs:
2424 linux:
25− name: Haskell-CI - Linux - GHC ${{ matrix.ghc }}
26− runs-on: ubuntu-18.04
25+ name: Haskell-CI - Linux - ${{ matrix.compiler }}
26+ runs-on: ubuntu-20.04
27+ timeout-minutes:
28+ 60
2729 container:
28− image: buildpack-deps:bionic
30+ image: buildpack-deps:jammy
2931 continue-on-error: ${{ matrix.allow-failure }}
3032 strategy:
3133 matrix:
3234 include:
33− - ghc: 8.10.3
35+ - compiler: ghc-9.12.1
36+ compilerKind: ghc
37+ compilerVersion: 9.12.1
38+ setup-method: ghcup
3439 allow-failure: false
35− - ghc: 8.8.4
40+ - compiler: ghc-9.10.1
41+ compilerKind: ghc
42+ compilerVersion: 9.10.1
43+ setup-method: ghcup
3644 allow-failure: false
37− - ghc: 8.6.4
45+ - compiler: ghc-9.8.4
46+ compilerKind: ghc
47+ compilerVersion: 9.8.4
48+ setup-method: ghcup
3849 allow-failure: false
39− - ghc: 8.4.4
50+ - compiler: ghc-9.6.6
51+ compilerKind: ghc
52+ compilerVersion: 9.6.6
53+ setup-method: ghcup
4054 allow-failure: false
41− - ghc: 8.2.2
55+ - compiler: ghc-9.4.8
56+ compilerKind: ghc
57+ compilerVersion: 9.4.8
58+ setup-method: ghcup
4259 allow-failure: false
43− - ghc: 8.0.2
60+ - compiler: ghc-9.2.8
61+ compilerKind: ghc
62+ compilerVersion: 9.2.8
63+ setup-method: ghcup
4464 allow-failure: false
45− - ghc: 7.10.3
65+ - compiler: ghc-9.0.2
66+ compilerKind: ghc
67+ compilerVersion: 9.0.2
68+ setup-method: ghcup
4669 allow-failure: false
47− - ghc: 7.8.4
70+ - compiler: ghc-8.10.7
71+ compilerKind: ghc
72+ compilerVersion: 8.10.7
73+ setup-method: ghcup
4874 allow-failure: false
49− - ghc: 7.6.3
75+ - compiler: ghc-8.8.4
76+ compilerKind: ghc
77+ compilerVersion: 8.8.4
78+ setup-method: ghcup
5079 allow-failure: false
51− - ghc: 7.4.2
80+ - compiler: ghc-8.6.5
81+ compilerKind: ghc
82+ compilerVersion: 8.6.5
83+ setup-method: ghcup
5284 allow-failure: false
5385 fail-fast: false
5486 steps:
55− - name: apt
87+ - name: apt-get install
5688 run: |
5789 apt-get update
58− apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common
59− apt-add-repository -y 'ppa:hvr/ghc'
60− apt-get update
61− apt-get install -y ghc-$GHC_VERSION cabal-install-3.2
90+ apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
91+ - name: Install GHCup
92+ run: |
93+ mkdir -p "$HOME/.ghcup/bin"
94+ curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$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.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
99+ echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.1.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"
62110 env:
63− GHC_VERSION: ${{ matrix.ghc }}
111+ HCKIND: ${{ matrix.compilerKind }}
112+ HCNAME: ${{ matrix.compiler }}
113+ HCVER: ${{ matrix.compilerVersion }}
64114 - name: Set PATH and environment variables
65115 run: |
66116 echo "$HOME/.cabal/bin" >> $GITHUB_PATH
67− echo "LANG=C.UTF-8" >> $GITHUB_ENV
68− echo "CABAL_DIR=$HOME/.cabal" >> $GITHUB_ENV
69− echo "CABAL_CONFIG=$HOME/.cabal/config" >> $GITHUB_ENV
70− HC=/opt/ghc/$GHC_VERSION/bin/ghc
71− echo "HC=$HC" >> $GITHUB_ENV
72− echo "HCPKG=/opt/ghc/$GHC_VERSION/bin/ghc-pkg" >> $GITHUB_ENV
73− echo "HADDOCK=/opt/ghc/$GHC_VERSION/bin/haddock" >> $GITHUB_ENV
74− echo "CABAL=/opt/cabal/3.2/bin/cabal -vnormal+nowrap" >> $GITHUB_ENV
117+ echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
118+ echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
119+ echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
75120 HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
76− echo "HCNUMVER=$HCNUMVER" >> $GITHUB_ENV
77− echo "ARG_TESTS=--enable-tests" >> $GITHUB_ENV
78− echo "ARG_BENCH=--enable-benchmarks" >> $GITHUB_ENV
79− echo "HEADHACKAGE=false" >> $GITHUB_ENV
80− echo "ARG_COMPILER=--ghc --with-compiler=/opt/ghc/$GHC_VERSION/bin/ghc" >> $GITHUB_ENV
81− echo "GHCJSARITH=0" >> $GITHUB_ENV
121+ echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
122+ echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
123+ echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
124+ echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
125+ echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
82126 env:
83− GHC_VERSION: ${{ matrix.ghc }}
127+ HCKIND: ${{ matrix.compilerKind }}
128+ HCNAME: ${{ matrix.compiler }}
129+ HCVER: ${{ matrix.compilerVersion }}
84130 - name: env
85131 run: |
86132 env
@@ -103,6 +149,10 @@ jobs:
103149 repository hackage.haskell.org
104150 url: http://hackage.haskell.org/
105151 EOF
152+ cat >> $CABAL_CONFIG <<EOF
153+ program-default-options
154+ ghc-options: $GHCJOBS +RTS -M3G -RTS
155+ EOF
106156 cat $CABAL_CONFIG
107157 - name: versions
108158 run: |
@@ -115,14 +165,14 @@ jobs:
115165 - name: install cabal-plan
116166 run: |
117167 mkdir -p $HOME/.cabal/bin
118− curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
119− echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
168+ curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz
169+ echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
120170 xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
121171 rm -f cabal-plan.xz
122172 chmod a+x $HOME/.cabal/bin/cabal-plan
123173 cabal-plan --version
124174 - name: checkout
125− uses: actions/checkout@v2
175+ uses: actions/checkout@v4
126176 with:
127177 path: source
128178 - name: initial cabal.project for sdist
@@ -142,32 +192,33 @@ jobs:
142192 - name: generate cabal.project
143193 run: |
144194 PKGDIR_uuid_types="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/uuid-types-[0-9.]*')"
145− echo "PKGDIR_uuid_types=${PKGDIR_uuid_types}" >> $GITHUB_ENV
195+ echo "PKGDIR_uuid_types=${PKGDIR_uuid_types}" >> "$GITHUB_ENV"
146196 PKGDIR_uuid="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/uuid-[0-9.]*')"
147− echo "PKGDIR_uuid=${PKGDIR_uuid}" >> $GITHUB_ENV
197+ echo "PKGDIR_uuid=${PKGDIR_uuid}" >> "$GITHUB_ENV"
198+ rm -f cabal.project cabal.project.local
148199 touch cabal.project
149200 touch cabal.project.local
150201 echo "packages: ${PKGDIR_uuid_types}" >> cabal.project
151202 echo "packages: ${PKGDIR_uuid}" >> cabal.project
152− if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package uuid-types" >> cabal.project ; fi
153− if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
154− if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package uuid" >> cabal.project ; fi
155− if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
203+ echo "package uuid-types" >> cabal.project
204+ echo " ghc-options: -Werror=missing-methods" >> cabal.project
205+ echo "package uuid" >> cabal.project
206+ echo " ghc-options: -Werror=missing-methods" >> cabal.project
156207 cat >> cabal.project <<EOF
157208 EOF
158− $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(uuid|uuid-types)$/; }' >> cabal.project.local
209+ $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(uuid|uuid-types)$/; }' >> cabal.project.local
159210 cat cabal.project
160211 cat cabal.project.local
161212 - name: dump install plan
162213 run: |
163214 $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
164215 cabal-plan
165− - name: cache
166− uses: actions/cache@v2
216+ - name: restore cache
217+ uses: actions/cache/restore@v4
167218 with:
168− key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
219+ key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
169220 path: ~/.cabal/store
170− restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
221+ restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
171222 - name: install dependencies
172223 run: |
173224 $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
@@ -189,8 +240,23 @@ jobs:
189240 ${CABAL} -vnormal check
190241 - name: haddock
191242 run: |
192− $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
243+ $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
193244 - name: unconstrained build
194245 run: |
195246 rm -f cabal.project.local
196247 $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
248+ - name: prepare for constraint sets
249+ run: |
250+ rm -f cabal.project.local
251+ - name: constraint set random-1.2
252+ run: |
253+ $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.2.*' all --dry-run
254+ cabal-plan topo | sort
255+ $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.2.*' --dependencies-only -j2 all
256+ $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.2.*' all
257+ - name: save cache
258+ if: always()
259+ uses: actions/cache/save@v4
260+ with:
261+ key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
262+ path: ~/.cabal/store