@@ -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.13.20211030
1212#
13−# REGENDATA ("0.11.20210214",["github","cabal.project"])
13+# REGENDATA ("0.13.20211030",["github","cabal.project"])
1414#
1515name: Haskell-CI
1616on:
@@ -22,7 +22,7 @@ on:
2222 - master
2323jobs:
2424 linux:
25− name: Haskell-CI - Linux - GHC ${{ matrix.ghc }}
25+ name: Haskell-CI - Linux - ${{ matrix.compiler }}
2626 runs-on: ubuntu-18.04
2727 container:
2828 image: buildpack-deps:bionic
@@ -30,57 +30,123 @@ jobs:
3030 strategy:
3131 matrix:
3232 include:
33− - ghc: 8.10.3
33+ - compiler: ghc-9.2.1
34+ compilerKind: ghc
35+ compilerVersion: 9.2.1
36+ setup-method: ghcup
3437 allow-failure: false
35− - ghc: 8.8.4
38+ - compiler: ghc-9.0.1
39+ compilerKind: ghc
40+ compilerVersion: 9.0.1
41+ setup-method: hvr-ppa
3642 allow-failure: false
37− - ghc: 8.6.4
43+ - compiler: ghc-8.10.7
44+ compilerKind: ghc
45+ compilerVersion: 8.10.7
46+ setup-method: ghcup
3847 allow-failure: false
39− - ghc: 8.4.4
48+ - compiler: ghc-8.8.4
49+ compilerKind: ghc
50+ compilerVersion: 8.8.4
51+ setup-method: hvr-ppa
4052 allow-failure: false
41− - ghc: 8.2.2
53+ - compiler: ghc-8.6.4
54+ compilerKind: ghc
55+ compilerVersion: 8.6.4
56+ setup-method: hvr-ppa
4257 allow-failure: false
43− - ghc: 8.0.2
58+ - compiler: ghc-8.4.4
59+ compilerKind: ghc
60+ compilerVersion: 8.4.4
61+ setup-method: hvr-ppa
4462 allow-failure: false
45− - ghc: 7.10.3
63+ - compiler: ghc-8.2.2
64+ compilerKind: ghc
65+ compilerVersion: 8.2.2
66+ setup-method: hvr-ppa
4667 allow-failure: false
47− - ghc: 7.8.4
68+ - compiler: ghc-8.0.2
69+ compilerKind: ghc
70+ compilerVersion: 8.0.2
71+ setup-method: hvr-ppa
4872 allow-failure: false
49− - ghc: 7.6.3
73+ - compiler: ghc-7.10.3
74+ compilerKind: ghc
75+ compilerVersion: 7.10.3
76+ setup-method: hvr-ppa
5077 allow-failure: false
51− - ghc: 7.4.2
78+ - compiler: ghc-7.8.4
79+ compilerKind: ghc
80+ compilerVersion: 7.8.4
81+ setup-method: hvr-ppa
82+ allow-failure: false
83+ - compiler: ghc-7.6.3
84+ compilerKind: ghc
85+ compilerVersion: 7.6.3
86+ setup-method: hvr-ppa
87+ allow-failure: false
88+ - compiler: ghc-7.4.2
89+ compilerKind: ghc
90+ compilerVersion: 7.4.2
91+ setup-method: hvr-ppa
5292 allow-failure: false
5393 fail-fast: false
5494 steps:
5595 - name: apt
5696 run: |
5797 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
98+ apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
99+ if [ "${{ matrix.setup-method }}" = ghcup ]; then
100+ mkdir -p "$HOME/.ghcup/bin"
101+ curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
102+ chmod a+x "$HOME/.ghcup/bin/ghcup"
103+ "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER"
104+ "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
105+ else
106+ apt-add-repository -y 'ppa:hvr/ghc'
107+ apt-get update
108+ apt-get install -y "$HCNAME"
109+ mkdir -p "$HOME/.ghcup/bin"
110+ curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
111+ chmod a+x "$HOME/.ghcup/bin/ghcup"
112+ "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
113+ fi
62114 env:
63− GHC_VERSION: ${{ matrix.ghc }}
115+ HCKIND: ${{ matrix.compilerKind }}
116+ HCNAME: ${{ matrix.compiler }}
117+ HCVER: ${{ matrix.compilerVersion }}
64118 - name: Set PATH and environment variables
65119 run: |
66120 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
121+ echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
122+ echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
123+ echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
124+ HCDIR=/opt/$HCKIND/$HCVER
125+ if [ "${{ matrix.setup-method }}" = ghcup ]; then
126+ HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
127+ echo "HC=$HC" >> "$GITHUB_ENV"
128+ echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
129+ echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
130+ echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
131+ else
132+ HC=$HCDIR/bin/$HCKIND
133+ echo "HC=$HC" >> "$GITHUB_ENV"
134+ echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
135+ echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
136+ echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
137+ fi
138+
75139 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
140+ echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
141+ echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
142+ echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
143+ echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
144+ echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
145+ echo "GHCJSARITH=0" >> "$GITHUB_ENV"
82146 env:
83− GHC_VERSION: ${{ matrix.ghc }}
147+ HCKIND: ${{ matrix.compilerKind }}
148+ HCNAME: ${{ matrix.compiler }}
149+ HCVER: ${{ matrix.compilerVersion }}
84150 - name: env
85151 run: |
86152 env
@@ -129,7 +195,7 @@ jobs:
129195 run: |
130196 touch cabal.project
131197 echo "packages: $GITHUB_WORKSPACE/source/uuid-types" >> cabal.project
132− echo "packages: $GITHUB_WORKSPACE/source/uuid" >> cabal.project
198+ if [ $((HCNUMVER < 90200)) -ne 0 ] ; then echo "packages: $GITHUB_WORKSPACE/source/uuid" >> cabal.project ; fi
133199 cat cabal.project
134200 - name: sdist
135201 run: |
@@ -142,17 +208,18 @@ jobs:
142208 - name: generate cabal.project
143209 run: |
144210 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
211+ echo "PKGDIR_uuid_types=${PKGDIR_uuid_types}" >> "$GITHUB_ENV"
146212 PKGDIR_uuid="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/uuid-[0-9.]*')"
147− echo "PKGDIR_uuid=${PKGDIR_uuid}" >> $GITHUB_ENV
213+ echo "PKGDIR_uuid=${PKGDIR_uuid}" >> "$GITHUB_ENV"
214+ rm -f cabal.project cabal.project.local
148215 touch cabal.project
149216 touch cabal.project.local
150217 echo "packages: ${PKGDIR_uuid_types}" >> cabal.project
151− echo "packages: ${PKGDIR_uuid}" >> cabal.project
218+ if [ $((HCNUMVER < 90200)) -ne 0 ] ; then echo "packages: ${PKGDIR_uuid}" >> cabal.project ; fi
152219 if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package uuid-types" >> cabal.project ; fi
153220 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
221+ if [ $((HCNUMVER >= 80200 && HCNUMVER < 90200)) -ne 0 ] ; then echo "package uuid" >> cabal.project ; fi
222+ if [ $((HCNUMVER >= 80200 && HCNUMVER < 90200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
156223 cat >> cabal.project <<EOF
157224 EOF
158225 $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(uuid|uuid-types)$/; }' >> cabal.project.local
@@ -165,9 +232,9 @@ jobs:
165232 - name: cache
166233 uses: actions/cache@v2
167234 with:
168− key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
235+ key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
169236 path: ~/.cabal/store
170− restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
237+ restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
171238 - name: install dependencies
172239 run: |
173240 $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
@@ -185,8 +252,8 @@ jobs:
185252 run: |
186253 cd ${PKGDIR_uuid_types} || false
187254 ${CABAL} -vnormal check
188− cd ${PKGDIR_uuid} || false
189− ${CABAL} -vnormal check
255+ if [ $((HCNUMVER < 90200)) -ne 0 ] ; then cd ${PKGDIR_uuid} || false ; fi
256+ if [ $((HCNUMVER < 90200)) -ne 0 ] ; then ${CABAL} -vnormal check ; fi
190257 - name: haddock
191258 run: |
192259 $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
@@ -199,7 +266,9 @@ jobs:
199266 rm -f cabal.project.local
200267 - name: constraint set random-1.2
201268 run: |
269+ if [ $((HCNUMVER >= 71000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.2.*' --dependencies-only -j2 all ; fi
202270 if [ $((HCNUMVER >= 71000)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.2.*' all ; fi
203271 - name: constraint set random-1.1
204272 run: |
273+ $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.1.*' --dependencies-only -j2 all
205274 $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='random==1.1.*' all