on master help sign in
Move coverage tests to github
1330ea4Harendra Kumar
.circleci/config.yml+3−3
@@ -59,7 +59,7 @@ env: &env
59 # If you have not committed packcheck.sh in your repo at PACKCHECK
59 # If you have not committed packcheck.sh in your repo at PACKCHECK
60 # then it is automatically pulled from this URL.
60 # then it is automatically pulled from this URL.
61 PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
61 PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
62− PACKCHECK_GITHUB_COMMIT: "8c77f80fd3a9df7307d06256c11a9e31d066475e"
62+ PACKCHECK_GITHUB_COMMIT: "35efa99b2082d13722b8a0183ac6455df98e91b9"
63
63
64executors:
64executors:
65 amd64-executor:
65 amd64-executor:
@@ -410,7 +410,7 @@ workflows:
410 #- stack-ghc-8.2
410 #- stack-ghc-8.2
411 #- coveralls-ghc-8.2.2
411 #- coveralls-ghc-8.2.2
412 #- coveralls-ghc-8.8.3
412 #- coveralls-ghc-8.8.3
413− - coveralls-ghc-8_10_2:
413+ #- coveralls-ghc-8_10_2:
414− name: GHC 8.10.2 + inspection + coverage + Werror
414+ # name: GHC 8.10.2 + inspection + coverage + Werror
415 - hlint-src:
415 - hlint-src:
416 name: Hlint src
416 name: Hlint src
.github/workflows/haskell.yml+60−24
@@ -10,40 +10,53 @@ jobs:
10 build:
10 build:
11 name: GHC ${{ matrix.name }}
11 name: GHC ${{ matrix.name }}
12 env:
12 env:
13− CABAL_REINIT_CONFIG: y
13+ # packcheck environment variables
14 LC_ALL: C.UTF-8
14 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−
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 }}
22+
23+ # Cabal options
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 }}
28+ CABAL_CHECK_RELAX: y
29+
30+ # Stack options
31+ STACK_UPGRADE: "y"
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"
40+
41+ # Pull token from "secrets" setting of the github repo
42+ COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
43+ COVERAGE: ${{ matrix.coverage }}
41
44
42 runs-on: ${{ matrix.runner }}
45 runs-on: ${{ matrix.runner }}
43 strategy:
46 strategy:
44 fail-fast: false
47 fail-fast: false
45 matrix:
48 matrix:
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
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
57+ - 8.6.5+streamk
58+ - 8.4.4+debug
59+ - doctests
47 cabal_version: ["3.4"]
60 cabal_version: ["3.4"]
48 include:
61 include:
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
81+ ghc_version: 8.10.4
82+ coverage: "y"
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
106
124
107 steps:
125 steps:
@@ -116,7 +134,8 @@ jobs:
116 name: Cache ~/.cabal
134 name: Cache ~/.cabal
117 with:
135 with:
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
120
139
121 - name: Download packcheck
140 - name: Download packcheck
122 run: |
141 run: |
@@ -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
128
147
129− - name: Run packcheck
148+ - name: Run tests
130 run: |
149 run: |
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
131− bash -c "$PACKCHECK_LOCAL_PATH $BUILD"
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
appveyor.yml+1−3
@@ -44,8 +44,6 @@ environment:
44 # cabal options
44 # cabal options
45 # ------------------------------------------------------------------------
45 # ------------------------------------------------------------------------
46 CABAL_CHECK_RELAX: "y"
46 CABAL_CHECK_RELAX: "y"
47− CABAL_NO_SANDBOX: "y"
48− CABAL_HACKAGE_MIRROR: "hackage.haskell.org:http://hackage.fpcomplete.com"
49
47
50 # ------------------------------------------------------------------------
48 # ------------------------------------------------------------------------
51 # Where to find the required tools
49 # Where to find the required tools
@@ -64,7 +62,7 @@ environment:
64 # If you have not committed packcheck.sh in your repo at PACKCHECK_LOCAL_PATH
62 # If you have not committed packcheck.sh in your repo at PACKCHECK_LOCAL_PATH
65 # then it is automatically pulled from this URL.
63 # then it is automatically pulled from this URL.
66 PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
64 PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
67− PACKCHECK_GITHUB_COMMIT: "8c77f80fd3a9df7307d06256c11a9e31d066475e"
65+ PACKCHECK_GITHUB_COMMIT: "35efa99b2082d13722b8a0183ac6455df98e91b9"
68
66
69 # Override the temp directory to avoid sed escaping issues
67 # Override the temp directory to avoid sed escaping issues
70 # See https://github.com/haskell/cabal/issues/5386
68 # See https://github.com/haskell/cabal/issues/5386
cabal.project.coverage+1−1
@@ -4,7 +4,7 @@ packages:
4
4
5package streamly
5package streamly
6 ghc-options: -Werror
6 ghc-options: -Werror
7− flags: inspection
7+ flag: inspection
8 coverage: true
8 coverage: true
9
9
10package streamly-tests
10package streamly-tests