on f2b2aa4 help sign in
167 lines 5.8 kB history raw
1name: Haskell CI
3on:
4 push:
5 branches:
6 - master
7 pull_request:
9jobs:
10 build:
11 name: GHC ${{ matrix.name }}
12 env:
13 # packcheck environment variables
14 LC_ALL: C.UTF-8
15 BUILD: ${{ matrix.build }}
16 GHCVER: ${{ matrix.ghc_version }}
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 }}
23 # Cabal options
24 CABAL_REINIT_CONFIG: y
25 CABAL_BUILD_OPTIONS: ${{ matrix.cabal_build_options }} --flag limit-build-mem
26 CABAL_BUILD_TARGETS: ${{ matrix.cabal_build_targets }}
27 CABAL_PROJECT: ${{ matrix.cabal_project }}
28 CABAL_CHECK_RELAX: y
30 # Stack options
31 STACK_UPGRADE: "y"
32 RESOLVER: ${{ matrix.resolver }}
33 STACK_YAML: ${{ matrix.stack_yaml }}
34 STACK_BUILD_OPTIONS: ${{ matrix.stack_build_options }}
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"
41 # Pull token from "secrets" setting of the github repo
42 COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
43 COVERAGE: ${{ matrix.coverage }}
45 runs-on: ${{ matrix.runner }}
46 strategy:
47 fail-fast: false
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
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
60 cabal_version: ["3.4"]
61 include:
62 - name: 9.0.1
63 ghc_version: 9.0.1
64 build: cabal-v2
65 cabal_build_options: "--allow-newer=hsc2hs"
66 disable_sdist_build: "y"
67 runner: ubuntu-latest
68 - name: 8.10.4+stack+nightly-2021-06-10
69 build: stack
70 resolver: nightly-2021-06-10
71 stack_yaml: stack.yaml
72 sdist_options: "--ignore-check"
73 stack_build_options: "--flag streamly-benchmarks:-opt"
74 runner: ubuntu-latest
75 - name: 8.10.4+macOS
76 ghc_version: 8.10.4
77 build: cabal-v2
78 disable_sdist_build: "y"
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
84 - name: 8.8.4+inspection+fusion-plugin+Werror
85 ghc_version: 8.8.4
86 build: cabal-v2
87 cabal_project: cabal.project.ci
88 cabal_build_options: "--flag fusion-plugin --flag inspection"
89 runner: ubuntu-latest
90 - name: 8.8.4
91 ghc_version: 8.8.4
92 build: cabal
93 cabal_project: cabal.project
94 cabal_build_options: "--flag -opt"
95 runner: ubuntu-latest
96 - name: 8.6.5+streamk
97 ghc_version: 8.6.5
98 build: cabal-v2
99 cabal_project: cabal.project
100 cabal_build_options: "--flag streamk --flag -opt"
101 runner: ubuntu-latest
102 - name: 8.6.5+fusion-plugin
103 ghc_version: 8.6.5
104 build: cabal-v2
105 cabal_project: cabal.project
106 cabal_build_options: "--flag fusion-plugin"
107 # haddock generation does not work with 8.6.5+fusion-plugin
108 disable_docs: "y"
109 runner: ubuntu-latest
110 - name: 8.4.4+debug
111 ghc_version: 8.4.4
112 build: cabal-v2
113 cabal_project: cabal.project
114 cabal_build_options: "--flag debug --flag -opt"
115 runner: ubuntu-latest
116 - name: doctests
117 ghc_version: 8.8.3
118 build: cabal-v2
119 cabal_build_options: "--flag doctests"
120 cabal_build_targets: doctests
121 disable_sdist_build: "y"
122 disable_dist_checks: "y"
123 runner: ubuntu-latest
125 steps:
126 - uses: actions/checkout@v2
128 - uses: haskell/actions/setup@v1
129 with:
130 ghc-version: ${{ matrix.ghc_version }}
131 cabal-version: ${{ matrix.cabal_version }}
133 - uses: actions/cache@v1
134 name: Cache ~/.cabal
135 with:
136 path: ~/.cabal
137 # Bump the key version to clear the cache
138 key: ${{ runner.os }}-${{ matrix.ghc_version }}-cabal-v1
140 - name: Download packcheck
141 run: |
142 # Get packcheck if needed
143 CURL=$(which curl)
144 PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
145 if test ! -e "$PACKCHECK_LOCAL_PATH"; then $CURL -sL -o "$PACKCHECK_LOCAL_PATH" $PACKCHECK_URL; fi;
146 chmod +x $PACKCHECK_LOCAL_PATH
148 - name: Run tests
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
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