@@ -0,0 +1,214 @@
1+# This GitHub workflow config has been generated by a script via
3+# haskell-ci 'github' 'html-parse.cabal'
5+# To regenerate the script (for example after adjusting tested-with) run
7+# haskell-ci regenerate
9+# For more information, see https://github.com/haskell-CI/haskell-ci
13+# REGENDATA ("0.12.1",["github","html-parse.cabal"])
21+ name: Haskell-CI - Linux - ${{ matrix.compiler }}
22+ runs-on: ubuntu-18.04
24+ image: buildpack-deps:xenial
25+ continue-on-error: ${{ matrix.allow-failure }}
29+ - compiler: ghc-8.10.4
31+ - compiler: ghc-8.10.3
33+ - compiler: ghc-8.10.2
35+ - compiler: ghc-8.10.1
37+ - compiler: ghc-8.8.4
39+ - compiler: ghc-8.8.3
41+ - compiler: ghc-8.8.2
43+ - compiler: ghc-8.8.1
45+ - compiler: ghc-8.6.5
47+ - compiler: ghc-8.6.4
49+ - compiler: ghc-8.6.3
51+ - compiler: ghc-8.6.2
53+ - compiler: ghc-8.6.1
55+ - compiler: ghc-8.4.4
57+ - compiler: ghc-8.4.3
59+ - compiler: ghc-8.4.2
61+ - compiler: ghc-8.4.1
63+ - compiler: ghc-8.2.2
65+ - compiler: ghc-8.2.1
67+ - compiler: ghc-8.0.2
69+ - compiler: ghc-8.0.1
71+ - compiler: ghc-7.10.3
73+ - compiler: ghc-7.10.2
75+ - compiler: ghc-7.10.1
82+ apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common
83+ apt-add-repository -y 'ppa:hvr/ghc'
85+ apt-get install -y $CC cabal-install-3.4
87+ CC: ${{ matrix.compiler }}
88+ - name: Set PATH and environment variables
90+ echo "$HOME/.cabal/bin" >> $GITHUB_PATH
91+ echo "LANG=C.UTF-8" >> $GITHUB_ENV
92+ echo "CABAL_DIR=$HOME/.cabal" >> $GITHUB_ENV
93+ echo "CABAL_CONFIG=$HOME/.cabal/config" >> $GITHUB_ENV
94+ HCDIR=$(echo "/opt/$CC" | sed 's/-/\//')
96+ HC=$HCDIR/bin/$HCNAME
97+ echo "HC=$HC" >> $GITHUB_ENV
98+ echo "HCPKG=$HCDIR/bin/$HCNAME-pkg" >> $GITHUB_ENV
99+ echo "HADDOCK=$HCDIR/bin/haddock" >> $GITHUB_ENV
100+ echo "CABAL=/opt/cabal/3.4/bin/cabal -vnormal+nowrap" >> $GITHUB_ENV
101+ HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
102+ echo "HCNUMVER=$HCNUMVER" >> $GITHUB_ENV
103+ echo "ARG_TESTS=--enable-tests" >> $GITHUB_ENV
104+ echo "ARG_BENCH=--enable-benchmarks" >> $GITHUB_ENV
105+ echo "HEADHACKAGE=false" >> $GITHUB_ENV
106+ echo "ARG_COMPILER=--$HCNAME --with-compiler=$HC" >> $GITHUB_ENV
107+ echo "GHCJSARITH=0" >> $GITHUB_ENV
109+ CC: ${{ matrix.compiler }}
113+ - name: write cabal config
116+ cat >> $CABAL_CONFIG <<EOF
117+ remote-build-reporting: anonymous
118+ write-ghc-environment-files: never
119+ remote-repo-cache: $CABAL_DIR/packages
120+ logs-dir: $CABAL_DIR/logs
121+ world-file: $CABAL_DIR/world
122+ extra-prog-path: $CABAL_DIR/bin
123+ symlink-bindir: $CABAL_DIR/bin
124+ installdir: $CABAL_DIR/bin
125+ build-summary: $CABAL_DIR/logs/build.log
126+ store-dir: $CABAL_DIR/store
129+ repository hackage.haskell.org
130+ url: http://hackage.haskell.org/
135+ $HC --version || true
136+ $HC --print-project-git-commit-id || true
137+ $CABAL --version || true
138+ - name: update cabal index
141+ - name: install cabal-plan
143+ mkdir -p $HOME/.cabal/bin
144+ 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
145+ echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
146+ xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
148+ chmod a+x $HOME/.cabal/bin/cabal-plan
149+ cabal-plan --version
151+ uses: actions/checkout@v2
154+ - name: initial cabal.project for sdist
157+ echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
162+ $CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
166+ find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
167+ - name: generate cabal.project
169+ PKGDIR_html_parse="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/html-parse-[0-9.]*')"
170+ echo "PKGDIR_html_parse=${PKGDIR_html_parse}" >> $GITHUB_ENV
172+ touch cabal.project.local
173+ echo "packages: ${PKGDIR_html_parse}" >> cabal.project
174+ if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package html-parse" >> cabal.project ; fi
175+ if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
176+ cat >> cabal.project <<EOF
178+ $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(html-parse)$/; }' >> cabal.project.local
180+ cat cabal.project.local
181+ - name: dump install plan
183+ $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
186+ uses: actions/cache@v2
188+ key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
189+ path: ~/.cabal/store
190+ restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
191+ - name: install dependencies
193+ $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
194+ $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
195+ - name: build w/o tests
197+ $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
200+ $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
203+ $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
206+ cd ${PKGDIR_html_parse} || false
207+ ${CABAL} -vnormal check
210+ $CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
211+ - name: unconstrained build
213+ rm -f cabal.project.local
214+ $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all