@@ -8,9 +8,9 @@
88#
99# For more information, see https://github.com/haskell-CI/haskell-ci
1010#
11−# version: 0.12
11+# version: 0.17.20231110
1212#
13−# REGENDATA ("0.12",["github","cabal.project"])
13+# REGENDATA ("0.17.20231110",["github","cabal.project"])
1414#
1515name: Haskell-CI
1616on:
@@ -23,12 +23,14 @@ on:
2323jobs:
2424 linux:
2525 name: Haskell-CI - Linux - ${{ matrix.compiler }}
26− runs-on: ubuntu-18.04
26+ runs-on: ubuntu-20.04
27+ timeout-minutes:
28+ 60
2729 container:
2830 image: buildpack-deps:bionic
2931 services:
3032 postgres:
31− image: postgres:10
33+ image: postgres:14
3234 env:
3335 POSTGRES_PASSWORD: postgres
3436 options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
@@ -36,59 +38,105 @@ jobs:
3638 strategy:
3739 matrix:
3840 include:
39− - compiler: ghc-9.0.1
41+ - compiler: ghc-9.8.1
42+ compilerKind: ghc
43+ compilerVersion: 9.8.1
44+ setup-method: ghcup
4045 allow-failure: false
41− - compiler: ghc-8.10.4
46+ - compiler: ghc-9.6.3
47+ compilerKind: ghc
48+ compilerVersion: 9.6.3
49+ setup-method: ghcup
4250 allow-failure: false
43− - compiler: ghc-8.8.4
44− allow-failure: false
45− - compiler: ghc-8.6.5
51+ - compiler: ghc-9.4.8
52+ compilerKind: ghc
53+ compilerVersion: 9.4.8
54+ setup-method: ghcup
4655 allow-failure: false
47− - compiler: ghc-8.4.4
56+ - compiler: ghc-9.2.8
57+ compilerKind: ghc
58+ compilerVersion: 9.2.8
59+ setup-method: ghcup
4860 allow-failure: false
49− - compiler: ghc-8.2.2
61+ - compiler: ghc-9.0.2
62+ compilerKind: ghc
63+ compilerVersion: 9.0.2
64+ setup-method: ghcup
5065 allow-failure: false
51− - compiler: ghc-8.0.2
66+ - compiler: ghc-8.10.7
67+ compilerKind: ghc
68+ compilerVersion: 8.10.7
69+ setup-method: ghcup
5270 allow-failure: false
53− - compiler: ghc-7.10.3
54− allow-failure: false
55− - compiler: ghc-7.8.4
71+ - compiler: ghc-8.8.4
72+ compilerKind: ghc
73+ compilerVersion: 8.8.4
74+ setup-method: hvr-ppa
5675 allow-failure: false
57− - compiler: ghc-7.6.3
76+ - compiler: ghc-8.6.5
77+ compilerKind: ghc
78+ compilerVersion: 8.6.5
79+ setup-method: hvr-ppa
5880 allow-failure: false
5981 fail-fast: false
6082 steps:
6183 - name: apt
6284 run: |
6385 apt-get update
64− apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common
65− apt-add-repository -y 'ppa:hvr/ghc'
66− apt-get update
67− apt-get install -y $CC cabal-install-3.4
86+ 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.20.0/x86_64-linux-ghcup-0.1.20.0 > "$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.2.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.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
99+ chmod a+x "$HOME/.ghcup/bin/ghcup"
100+ "$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
101+ fi
68102 env:
69− CC: ${{ matrix.compiler }}
103+ HCKIND: ${{ matrix.compilerKind }}
104+ HCNAME: ${{ matrix.compiler }}
105+ HCVER: ${{ matrix.compilerVersion }}
70106 - name: Set PATH and environment variables
71107 run: |
72108 echo "$HOME/.cabal/bin" >> $GITHUB_PATH
73− echo "LANG=C.UTF-8" >> $GITHUB_ENV
74− echo "CABAL_DIR=$HOME/.cabal" >> $GITHUB_ENV
75− echo "CABAL_CONFIG=$HOME/.cabal/config" >> $GITHUB_ENV
76− HCDIR=$(echo "/opt/$CC" | sed 's/-/\//')
77− HCNAME=ghc
78− HC=$HCDIR/bin/$HCNAME
79− echo "HC=$HC" >> $GITHUB_ENV
80− echo "HCPKG=$HCDIR/bin/$HCNAME-pkg" >> $GITHUB_ENV
81− echo "HADDOCK=$HCDIR/bin/haddock" >> $GITHUB_ENV
82− echo "CABAL=/opt/cabal/3.4/bin/cabal -vnormal+nowrap" >> $GITHUB_ENV
109+ echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
110+ echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
111+ 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/ghcup" whereis ghc "$HCVER")
115+ HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
116+ HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
117+ echo "HC=$HC" >> "$GITHUB_ENV"
118+ echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
119+ echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
120+ echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
121+ else
122+ HC=$HCDIR/bin/$HCKIND
123+ echo "HC=$HC" >> "$GITHUB_ENV"
124+ echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
125+ echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
126+ echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
127+ fi
128+
83129 HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
84− echo "HCNUMVER=$HCNUMVER" >> $GITHUB_ENV
85− echo "ARG_TESTS=--enable-tests" >> $GITHUB_ENV
86− echo "ARG_BENCH=--enable-benchmarks" >> $GITHUB_ENV
87− echo "HEADHACKAGE=false" >> $GITHUB_ENV
88− echo "ARG_COMPILER=--$HCNAME --with-compiler=$HC" >> $GITHUB_ENV
89− echo "GHCJSARITH=0" >> $GITHUB_ENV
130+ echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
131+ echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
132+ echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
133+ echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
134+ echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
135+ echo "GHCJSARITH=0" >> "$GITHUB_ENV"
90136 env:
91− CC: ${{ matrix.compiler }}
137+ HCKIND: ${{ matrix.compilerKind }}
138+ HCNAME: ${{ matrix.compiler }}
139+ HCVER: ${{ matrix.compilerVersion }}
92140 - name: env
93141 run: |
94142 env
@@ -111,6 +159,10 @@ jobs:
111159 repository hackage.haskell.org
112160 url: http://hackage.haskell.org/
113161 EOF
162+ cat >> $CABAL_CONFIG <<EOF
163+ program-default-options
164+ ghc-options: $GHCJOBS +RTS -M3G -RTS
165+ EOF
114166 cat $CABAL_CONFIG
115167 - name: versions
116168 run: |
@@ -123,14 +175,14 @@ jobs:
123175 - name: install cabal-plan
124176 run: |
125177 mkdir -p $HOME/.cabal/bin
126− 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
127− echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
178+ 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
179+ echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
128180 xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
129181 rm -f cabal-plan.xz
130182 chmod a+x $HOME/.cabal/bin/cabal-plan
131183 cabal-plan --version
132184 - name: checkout
133− uses: actions/checkout@v2
185+ uses: actions/checkout@v3
134186 with:
135187 path: source
136188 - name: initial cabal.project for sdist
@@ -149,12 +201,13 @@ jobs:
149201 - name: generate cabal.project
150202 run: |
151203 PKGDIR_postgresql_simple="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/postgresql-simple-[0-9.]*')"
152− echo "PKGDIR_postgresql_simple=${PKGDIR_postgresql_simple}" >> $GITHUB_ENV
204+ echo "PKGDIR_postgresql_simple=${PKGDIR_postgresql_simple}" >> "$GITHUB_ENV"
205+ rm -f cabal.project cabal.project.local
153206 touch cabal.project
154207 touch cabal.project.local
155208 echo "packages: ${PKGDIR_postgresql_simple}" >> cabal.project
156− if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package postgresql-simple" >> cabal.project ; fi
157− if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
209+ echo "package postgresql-simple" >> cabal.project
210+ echo " ghc-options: -Werror=missing-methods" >> cabal.project
158211 cat >> cabal.project <<EOF
159212 allow-newer: cryptohash-md5-0.11.100.1:base
160213 EOF
@@ -165,8 +218,8 @@ jobs:
165218 run: |
166219 $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
167220 cabal-plan
168− - name: cache
169− uses: actions/cache@v2
221+ - name: restore cache
222+ uses: actions/cache/restore@v3
170223 with:
171224 key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
172225 path: ~/.cabal/store
@@ -190,8 +243,14 @@ jobs:
190243 ${CABAL} -vnormal check
191244 - name: haddock
192245 run: |
193− $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
246+ $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
194247 - name: unconstrained build
195248 run: |
196249 rm -f cabal.project.local
197250 $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
251+ - name: save cache
252+ uses: actions/cache/save@v3
253+ if: always()
254+ with:
255+ key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
256+ path: ~/.cabal/store