@@ -10,40 +10,53 @@ jobs:
11 name: GHC ${{ matrix.name }}
11 name: GHC ${{ matrix.name }}
13− CABAL_REINIT_CONFIG: y
13+ # packcheck environment variables
14 LC_ALL: C.UTF-8
14 LC_ALL: C.UTF-8
22− CABAL_HACKAGE_MIRROR: hackage.haskell.org:http://hackage.fpcomplete.com
24− PACKCHECK_LOCAL_PATH: "./packcheck.sh"
25− PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
26− PACKCHECK_GITHUB_COMMIT: "8c77f80fd3a9df7307d06256c11a9e31d066475e"
28 BUILD: ${{ matrix.build }}
15 BUILD: ${{ matrix.build }}
29 GHCVER: ${{ matrix.ghc_version }}
16 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 }}
24+ CABAL_REINIT_CONFIG: y
31 CABAL_BUILD_OPTIONS: ${{ matrix.cabal_build_options }} --flag limit-build-mem
25 CABAL_BUILD_OPTIONS: ${{ matrix.cabal_build_options }} --flag limit-build-mem
32 CABAL_BUILD_TARGETS: ${{ matrix.cabal_build_targets }}
26 CABAL_BUILD_TARGETS: ${{ matrix.cabal_build_targets }}
33 CABAL_PROJECT: ${{ matrix.cabal_project }}
27 CABAL_PROJECT: ${{ matrix.cabal_project }}
32+ RESOLVER: ${{ matrix.resolver }}
34 STACK_YAML: ${{ matrix.stack_yaml }}
33 STACK_YAML: ${{ matrix.stack_yaml }}
35 STACK_BUILD_OPTIONS: ${{ matrix.stack_build_options }}
34 STACK_BUILD_OPTIONS: ${{ matrix.stack_build_options }}
36− DISABLE_DOCS: ${{ matrix.disable_docs }}
35+
37− DISABLE_TEST: ${{ matrix.disable_test }}
36+ # packcheck location and revision
38− SDIST_OPTIONS: ${{ matrix.sdist_options }}
37+ PACKCHECK_LOCAL_PATH: "./packcheck.sh"
39− DISABLE_SDIST_BUILD: ${{ matrix.disable_sdist_build }}
38+ PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
40− DISABLE_DIST_CHECKS: ${{ matrix.disable_dist_checks }}
39+ PACKCHECK_GITHUB_COMMIT: "35efa99b2082d13722b8a0183ac6455df98e91b9"
41+ # Pull token from "secrets" setting of the github repo
42+ COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
43+ COVERAGE: ${{ matrix.coverage }}
42 runs-on: ${{ matrix.runner }}
45 runs-on: ${{ matrix.runner }}
44 fail-fast: false
47 fail-fast: false
51+ - 8.10.4+stack+nightly-2021-06-10
53+ - 8.10.4+linux+coverage+cabal
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]
55+ - 8.8.4+inspection+fusion-plugin+Werror
56+ - 8.6.5+fusion-plugin
47 cabal_version: ["3.4"]
60 cabal_version: ["3.4"]
49 - name: 9.0.1
62 - name: 9.0.1
@@ -64,6 +77,10 @@ jobs:
64 build: cabal-v2
77 build: cabal-v2
65 disable_sdist_build: "y"
78 disable_sdist_build: "y"
66 runner: macos-latest
79 runner: macos-latest
80+ - name: 8.10.4+linux+coverage+cabal
83+ runner: ubuntu-latest
67 - name: 8.8.4+inspection+fusion-plugin+Werror
84 - name: 8.8.4+inspection+fusion-plugin+Werror
68 ghc_version: 8.8.4
85 ghc_version: 8.8.4
69 build: cabal-v2
86 build: cabal-v2
@@ -102,6 +119,7 @@ jobs:
102 cabal_build_options: "--flag doctests"
119 cabal_build_options: "--flag doctests"
103 cabal_build_targets: doctests
120 cabal_build_targets: doctests
104 disable_sdist_build: "y"
121 disable_sdist_build: "y"
122+ disable_dist_checks: "y"
105 runner: ubuntu-latest
123 runner: ubuntu-latest
@@ -116,7 +134,8 @@ jobs:
116 name: Cache ~/.cabal
134 name: Cache ~/.cabal
118 path: ~/.cabal
136 path: ~/.cabal
137+ # Bump the key version to clear the cache
119− key: ${{ runner.os }}-${{ matrix.ghc_version }}-cabal
138+ key: ${{ runner.os }}-${{ matrix.ghc_version }}-cabal-v1
121 - name: Download packcheck
140 - name: Download packcheck
@@ -126,6 +145,23 @@ jobs:
126 if test ! -e "$PACKCHECK_LOCAL_PATH"; then $CURL -sL -o "$PACKCHECK_LOCAL_PATH" $PACKCHECK_URL; fi;
145 if test ! -e "$PACKCHECK_LOCAL_PATH"; then $CURL -sL -o "$PACKCHECK_LOCAL_PATH" $PACKCHECK_URL; fi;
127 chmod +x $PACKCHECK_LOCAL_PATH
146 chmod +x $PACKCHECK_LOCAL_PATH
129− - name: Run packcheck
148+ - name: Run tests
150+ if test -z "$COVERAGE"
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
131− bash -c "$PACKCHECK_LOCAL_PATH $BUILD"
155+ bash -c "$PACKCHECK_LOCAL_PATH $BUILD"
157+ # Run tests with coverage
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