@@ -10,40 +10,53 @@ jobs:
1010 build:
1111 name: GHC ${{ matrix.name }}
1212 env:
13− CABAL_REINIT_CONFIG: y
13+ # packcheck environment variables
1414 LC_ALL: C.UTF-8
15−
16− ENABLE_INSTALL: "n"
17−
18− STACK_UPGRADE: "y"
19−
20− CABAL_CHECK_RELAX: y
21− CABAL_NO_SANDBOX: y
22− CABAL_HACKAGE_MIRROR: hackage.haskell.org:http://hackage.fpcomplete.com
23−
24− PACKCHECK_LOCAL_PATH: "./packcheck.sh"
25− PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
26− PACKCHECK_GITHUB_COMMIT: "8c77f80fd3a9df7307d06256c11a9e31d066475e"
27−
2815 BUILD: ${{ matrix.build }}
2916 GHCVER: ${{ matrix.ghc_version }}
30− RESOLVER: ${{ matrix.resolver }}
17+ DISABLE_DOCS: ${{ matrix.disable_docs }}
18+ DISABLE_TEST: ${{ matrix.disable_test }}
19+ DISABLE_DIST_CHECKS: ${{ matrix.disable_dist_checks }}
20+ SDIST_OPTIONS: ${{ matrix.sdist_options }}
21+ DISABLE_SDIST_BUILD: ${{ matrix.disable_sdist_build }}
22+
23+ # Cabal options
24+ CABAL_REINIT_CONFIG: y
3125 CABAL_BUILD_OPTIONS: ${{ matrix.cabal_build_options }} --flag limit-build-mem
3226 CABAL_BUILD_TARGETS: ${{ matrix.cabal_build_targets }}
3327 CABAL_PROJECT: ${{ matrix.cabal_project }}
28+ CABAL_CHECK_RELAX: y
29+
30+ # Stack options
31+ STACK_UPGRADE: "y"
32+ RESOLVER: ${{ matrix.resolver }}
3433 STACK_YAML: ${{ matrix.stack_yaml }}
3534 STACK_BUILD_OPTIONS: ${{ matrix.stack_build_options }}
36− DISABLE_DOCS: ${{ matrix.disable_docs }}
37− DISABLE_TEST: ${{ matrix.disable_test }}
38− SDIST_OPTIONS: ${{ matrix.sdist_options }}
39− DISABLE_SDIST_BUILD: ${{ matrix.disable_sdist_build }}
40− DISABLE_DIST_CHECKS: ${{ matrix.disable_dist_checks }}
35+
36+ # packcheck location and revision
37+ PACKCHECK_LOCAL_PATH: "./packcheck.sh"
38+ PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
39+ PACKCHECK_GITHUB_COMMIT: "35efa99b2082d13722b8a0183ac6455df98e91b9"
40+
41+ # Pull token from "secrets" setting of the github repo
42+ COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
43+ COVERAGE: ${{ matrix.coverage }}
4144
4245 runs-on: ${{ matrix.runner }}
4346 strategy:
4447 fail-fast: false
4548 matrix:
46− name: [9.0.1, 8.10.4+stack+nightly-2021-06-10, 8.10.4+macOS, 8.8.4+inspection+fusion-plugin+Werror, 8.8.4, 8.6.5+fusion-plugin, 8.6.5+streamk, 8.4.4+debug, doctests]
49+ name:
50+ - 9.0.1
51+ - 8.10.4+stack+nightly-2021-06-10
52+ - 8.10.4+macOS
53+ - 8.10.4+linux+coverage+cabal
54+ - 8.8.4
55+ - 8.8.4+inspection+fusion-plugin+Werror
56+ - 8.6.5+fusion-plugin
57+ - 8.6.5+streamk
58+ - 8.4.4+debug
59+ - doctests
4760 cabal_version: ["3.4"]
4861 include:
4962 - name: 9.0.1
@@ -64,6 +77,10 @@ jobs:
6477 build: cabal-v2
6578 disable_sdist_build: "y"
6679 runner: macos-latest
80+ - name: 8.10.4+linux+coverage+cabal
81+ ghc_version: 8.10.4
82+ coverage: "y"
83+ runner: ubuntu-latest
6784 - name: 8.8.4+inspection+fusion-plugin+Werror
6885 ghc_version: 8.8.4
6986 build: cabal-v2
@@ -102,6 +119,7 @@ jobs:
102119 cabal_build_options: "--flag doctests"
103120 cabal_build_targets: doctests
104121 disable_sdist_build: "y"
122+ disable_dist_checks: "y"
105123 runner: ubuntu-latest
106124
107125 steps:
@@ -116,7 +134,8 @@ jobs:
116134 name: Cache ~/.cabal
117135 with:
118136 path: ~/.cabal
119− key: ${{ runner.os }}-${{ matrix.ghc_version }}-cabal
137+ # Bump the key version to clear the cache
138+ key: ${{ runner.os }}-${{ matrix.ghc_version }}-cabal-v1
120139
121140 - name: Download packcheck
122141 run: |
@@ -126,6 +145,23 @@ jobs:
126145 if test ! -e "$PACKCHECK_LOCAL_PATH"; then $CURL -sL -o "$PACKCHECK_LOCAL_PATH" $PACKCHECK_URL; fi;
127146 chmod +x $PACKCHECK_LOCAL_PATH
128147
129− - name: Run packcheck
148+ - name: Run tests
130149 run: |
131− bash -c "$PACKCHECK_LOCAL_PATH $BUILD"
150+ if test -z "$COVERAGE"
151+ then
152+ export TOOLS_DIR=/opt
153+ # /usr/local/opt/curl/bin for macOS
154+ export PATH=$HOME/.local/bin:$HOME/.ghcup/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/opt/curl/bin
155+ bash -c "$PACKCHECK_LOCAL_PATH $BUILD"
156+ else
157+ # Run tests with coverage
158+ cabal update
159+ cabal user-config update -a "jobs: 1"
160+ # Build hpc-coveralls if needed
161+ sudo apt-get install -y libcurl4-gnutls-dev
162+ export PATH=$HOME/.cabal/bin:$PATH
163+ which hpc-coveralls 2>/dev/null || cabal install --project-file cabal.project.hpc-coveralls hpc-coveralls
164+ # Run tests and upload results to coveralls.io
165+ bin/test.sh --coverage --raw
166+ hpc-coveralls --repo-token="$COVERALLS_TOKEN" --coverage-mode=StrictlyFullLines
167+ fi