11# This GitHub workflow config has been generated by a script via
22#
3- # haskell-ci 'github' './ attoparsec.cabal' '--no- benchmarks' '--branches ' 'master '
3+ # haskell-ci 'github' 'attoparsec.cabal' '--benchmarks-jobs ' '>=7.8 '
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.12.1
11+ # version: 0.14
1212#
13- # REGENDATA ("0.12.1 ",["github","./ attoparsec.cabal","--no- benchmarks","--branches ","master "])
13+ # REGENDATA ("0.14 ",["github","attoparsec.cabal","--benchmarks-jobs ",">=7.8 "])
1414#
1515name : Haskell-CI
1616on :
17- push :
18- branches :
19- - master
20- pull_request :
21- branches :
22- - master
17+ - push
18+ - pull_request
2319jobs :
2420 linux :
2521 name : Haskell-CI - Linux - ${{ matrix.compiler }}
2622 runs-on : ubuntu-18.04
23+ timeout-minutes :
24+ 60
2725 container :
28- image : buildpack-deps:xenial
26+ image : buildpack-deps:bionic
2927 continue-on-error : ${{ matrix.allow-failure }}
3028 strategy :
3129 matrix :
3230 include :
33- - compiler : ghc-9.0.1
31+ - compiler : ghc-9.2.1
32+ compilerKind : ghc
33+ compilerVersion : 9.2.1
34+ setup-method : ghcup
3435 allow-failure : false
35- - compiler : ghc-8.10.4
36+ - compiler : ghc-9.0.2
37+ compilerKind : ghc
38+ compilerVersion : 9.0.2
39+ setup-method : ghcup
40+ allow-failure : false
41+ - compiler : ghc-8.10.7
42+ compilerKind : ghc
43+ compilerVersion : 8.10.7
44+ setup-method : ghcup
3645 allow-failure : false
3746 - compiler : ghc-8.8.4
47+ compilerKind : ghc
48+ compilerVersion : 8.8.4
49+ setup-method : hvr-ppa
3850 allow-failure : false
3951 - compiler : ghc-8.6.5
52+ compilerKind : ghc
53+ compilerVersion : 8.6.5
54+ setup-method : hvr-ppa
4055 allow-failure : false
4156 - compiler : ghc-8.4.4
57+ compilerKind : ghc
58+ compilerVersion : 8.4.4
59+ setup-method : hvr-ppa
4260 allow-failure : false
4361 - compiler : ghc-8.2.2
62+ compilerKind : ghc
63+ compilerVersion : 8.2.2
64+ setup-method : hvr-ppa
4465 allow-failure : false
4566 - compiler : ghc-8.0.2
67+ compilerKind : ghc
68+ compilerVersion : 8.0.2
69+ setup-method : hvr-ppa
4670 allow-failure : false
4771 - compiler : ghc-7.10.3
72+ compilerKind : ghc
73+ compilerVersion : 7.10.3
74+ setup-method : hvr-ppa
4875 allow-failure : false
4976 - compiler : ghc-7.8.4
77+ compilerKind : ghc
78+ compilerVersion : 7.8.4
79+ setup-method : hvr-ppa
5080 allow-failure : false
5181 - compiler : ghc-7.6.3
82+ compilerKind : ghc
83+ compilerVersion : 7.6.3
84+ setup-method : hvr-ppa
5285 allow-failure : false
5386 - compiler : ghc-7.4.2
87+ compilerKind : ghc
88+ compilerVersion : 7.4.2
89+ setup-method : hvr-ppa
5490 allow-failure : false
5591 fail-fast : false
5692 steps :
5793 - name : apt
5894 run : |
5995 apt-get update
60- apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common
61- apt-add-repository -y 'ppa:hvr/ghc'
62- apt-get update
63- apt-get install -y $CC cabal-install-3.4
96+ apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
97+ if [ "${{ matrix.setup-method }}" = ghcup ]; then
98+ mkdir -p "$HOME/.ghcup/bin"
99+ curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
100+ chmod a+x "$HOME/.ghcup/bin/ghcup"
101+ "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER"
102+ "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
103+ else
104+ apt-add-repository -y 'ppa:hvr/ghc'
105+ apt-get update
106+ apt-get install -y "$HCNAME"
107+ mkdir -p "$HOME/.ghcup/bin"
108+ curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup"
109+ chmod a+x "$HOME/.ghcup/bin/ghcup"
110+ "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0
111+ fi
64112 env :
65- CC : ${{ matrix.compiler }}
113+ HCKIND : ${{ matrix.compilerKind }}
114+ HCNAME : ${{ matrix.compiler }}
115+ HCVER : ${{ matrix.compilerVersion }}
66116 - name : Set PATH and environment variables
67117 run : |
68118 echo "$HOME/.cabal/bin" >> $GITHUB_PATH
69- echo "LANG=C.UTF-8" >> $GITHUB_ENV
70- echo "CABAL_DIR=$HOME/.cabal" >> $GITHUB_ENV
71- echo "CABAL_CONFIG=$HOME/.cabal/config" >> $GITHUB_ENV
72- HCDIR=$(echo "/opt/$CC" | sed 's/-/\//')
73- HCNAME=ghc
74- HC=$HCDIR/bin/$HCNAME
75- echo "HC=$HC" >> $GITHUB_ENV
76- echo "HCPKG=$HCDIR/bin/$HCNAME-pkg" >> $GITHUB_ENV
77- echo "HADDOCK=$HCDIR/bin/haddock" >> $GITHUB_ENV
78- echo "CABAL=/opt/cabal/3.4/bin/cabal -vnormal+nowrap" >> $GITHUB_ENV
119+ echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
120+ echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
121+ echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
122+ HCDIR=/opt/$HCKIND/$HCVER
123+ if [ "${{ matrix.setup-method }}" = ghcup ]; then
124+ HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
125+ echo "HC=$HC" >> "$GITHUB_ENV"
126+ echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
127+ echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
128+ echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
129+ else
130+ HC=$HCDIR/bin/$HCKIND
131+ echo "HC=$HC" >> "$GITHUB_ENV"
132+ echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV"
133+ echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV"
134+ echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
135+ fi
136+
79137 HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
80- echo "HCNUMVER=$HCNUMVER" >> $GITHUB_ENV
81- echo "ARG_TESTS=--enable-tests" >> $GITHUB_ENV
82- echo "ARG_BENCH=--disable-benchmarks" >> $GITHUB_ENV
83- echo "HEADHACKAGE=false" >> $GITHUB_ENV
84- echo "ARG_COMPILER=--$HCNAME --with-compiler=$HC" >> $GITHUB_ENV
85- echo "GHCJSARITH=0" >> $GITHUB_ENV
138+ echo "HCNUMVER=$HCNUMVER" >> " $GITHUB_ENV"
139+ echo "ARG_TESTS=--enable-tests" >> " $GITHUB_ENV"
140+ if [ $((HCNUMVER >= 70800)) -ne 0 ] ; then echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" ; else echo "ARG_BENCH=-- disable-benchmarks" >> " $GITHUB_ENV" ; fi
141+ echo "HEADHACKAGE=false" >> " $GITHUB_ENV"
142+ echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> " $GITHUB_ENV"
143+ echo "GHCJSARITH=0" >> " $GITHUB_ENV"
86144 env :
87- CC : ${{ matrix.compiler }}
145+ HCKIND : ${{ matrix.compilerKind }}
146+ HCNAME : ${{ matrix.compiler }}
147+ HCVER : ${{ matrix.compilerVersion }}
88148 - name : env
89149 run : |
90150 env
@@ -107,6 +167,10 @@ jobs:
107167 repository hackage.haskell.org
108168 url: http://hackage.haskell.org/
109169 EOF
170+ cat >> $CABAL_CONFIG <<EOF
171+ program-default-options
172+ ghc-options: $GHCJOBS +RTS -M3G -RTS
173+ EOF
110174 cat $CABAL_CONFIG
111175 - name : versions
112176 run : |
@@ -145,7 +209,8 @@ jobs:
145209 - name : generate cabal.project
146210 run : |
147211 PKGDIR_attoparsec="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/attoparsec-[0-9.]*')"
148- echo "PKGDIR_attoparsec=${PKGDIR_attoparsec}" >> $GITHUB_ENV
212+ echo "PKGDIR_attoparsec=${PKGDIR_attoparsec}" >> "$GITHUB_ENV"
213+ rm -f cabal.project cabal.project.local
149214 touch cabal.project
150215 touch cabal.project.local
151216 echo "packages: ${PKGDIR_attoparsec}" >> cabal.project
@@ -190,3 +255,16 @@ jobs:
190255 run : |
191256 rm -f cabal.project.local
192257 $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
258+ - name : prepare for constraint sets
259+ run : |
260+ rm -f cabal.project.local
261+ - name : constraint set text-2
262+ run : |
263+ if [ $((HCNUMVER >= 80400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='text >= 2' --dependencies-only -j2 all ; fi
264+ if [ $((HCNUMVER >= 80400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='text >= 2' all ; fi
265+ if [ $((HCNUMVER >= 80400)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='text >= 2' all ; fi
266+ - name : constraint set text-1
267+ run : |
268+ if [ $((HCNUMVER < 80400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='text < 2' --dependencies-only -j2 all ; fi
269+ if [ $((HCNUMVER < 80400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='text < 2' all ; fi
270+ if [ $((HCNUMVER < 80400)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='text < 2' all ; fi
0 commit comments