on cfcf26d help sign in
199 lines 7.1 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 # Github has machines with 2 CPUS and 6GB memory so the cabal jobs
26 # default (ncpus) is good, this can be checked from the packcheck
27 # output in case it changes.
28 CABAL_BUILD_OPTIONS: ${{ matrix.cabal_build_options }} --flag limit-build-mem
29 CABAL_BUILD_TARGETS: ${{ matrix.cabal_build_targets }}
30 CABAL_PROJECT: ${{ matrix.cabal_project }}
31 CABAL_CHECK_RELAX: y
33 # Stack options
34 STACK_UPGRADE: "y"
35 RESOLVER: ${{ matrix.resolver }}
36 STACK_YAML: ${{ matrix.stack_yaml }}
37 STACK_BUILD_OPTIONS: ${{ matrix.stack_build_options }}
39 # packcheck location and revision
40 PACKCHECK_LOCAL_PATH: "./packcheck.sh"
41 PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
42 PACKCHECK_GITHUB_COMMIT: "35efa99b2082d13722b8a0183ac6455df98e91b9"
44 # Pull token from "secrets" setting of the github repo
45 COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
46 COVERAGE: ${{ matrix.coverage }}
47 DOCTEST: ${{ matrix.doctest }}
49 runs-on: ${{ matrix.runner }}
50 strategy:
51 fail-fast: false
52 matrix:
53 name:
54 - 9.2.1
55 - 9.0.1
56 - 8.10.4+stack
57 - 8.10.4+macOS
58 - 8.10.4+linux+coverage+cabal
59 - 8.10.4+docspec
60 - 8.8.4
61 - 8.8.4+inspection+fusion-plugin+Werror
62 - 8.6.5+fusion-plugin
63 - 8.6.5+streamk
64 - 8.4.4+debug
65 include:
66 - name: 9.2.1
67 ghc_version: 9.2.1
68 build: cabal-v2
69 cabal_build_options: "--allow-newer=hsc2hs"
70 disable_sdist_build: "y"
71 runner: ubuntu-latest
72 cabal_version: 3.6
73 - name: 9.0.1
74 ghc_version: 9.0.1
75 build: cabal-v2
76 cabal_build_options: "--allow-newer=hsc2hs"
77 disable_sdist_build: "y"
78 runner: ubuntu-latest
79 cabal_version: 3.4
80 - name: 8.10.4+stack
81 build: stack
82 resolver: lts-18.0
83 stack_yaml: stack.yaml
84 sdist_options: "--ignore-check"
85 stack_build_options: "--flag streamly-benchmarks:-opt"
86 runner: ubuntu-latest
87 cabal_version: 3.4
88 - name: 8.10.4+macOS
89 ghc_version: 8.10.4
90 build: cabal-v2
91 disable_sdist_build: "y"
92 runner: macos-latest
93 cabal_version: 3.4
94 - name: 8.10.4+linux+coverage+cabal
95 ghc_version: 8.10.4
96 coverage: "y"
97 runner: ubuntu-latest
98 cabal_version: 3.4
99 - name: 8.8.4+inspection+fusion-plugin+Werror
100 ghc_version: 8.8.4
101 build: cabal-v2
102 cabal_project: cabal.project.Werror
103 cabal_build_options: "--flag fusion-plugin --flag inspection"
104 runner: ubuntu-latest
105 cabal_version: 3.4
106 - name: 8.8.4
107 ghc_version: 8.8.4
108 build: cabal
109 cabal_project: cabal.project
110 cabal_build_options: "--flag -opt"
111 runner: ubuntu-latest
112 cabal_version: 3.4
113 - name: 8.6.5+streamk
114 ghc_version: 8.6.5
115 build: cabal-v2
116 cabal_project: cabal.project
117 cabal_build_options: "--flag streamk --flag -opt"
118 runner: ubuntu-latest
119 cabal_version: 3.4
120 - name: 8.6.5+fusion-plugin
121 ghc_version: 8.6.5
122 build: cabal-v2
123 cabal_project: cabal.project
124 cabal_build_options: "--flag fusion-plugin"
125 # haddock generation does not work with 8.6.5+fusion-plugin
126 disable_docs: "y"
127 runner: ubuntu-latest
128 cabal_version: 3.4
129 - name: 8.4.4+debug
130 ghc_version: 8.4.4
131 build: cabal-v2
132 cabal_project: cabal.project
133 cabal_build_options: "--flag debug --flag -opt"
134 runner: ubuntu-latest
135 cabal_version: 3.4
136 - name: 8.10.4+docspec
137 ghc_version: 8.10.4
138 doctest: "y"
139 runner: ubuntu-latest
140 cabal_version: 3.4
142 steps:
143 - uses: actions/checkout@v2
145 - uses: haskell/actions/setup@v1
146 with:
147 ghc-version: ${{ matrix.ghc_version }}
148 cabal-version: ${{ matrix.cabal_version }}
150 - uses: actions/cache@v1
151 name: Cache ~/.cabal
152 with:
153 path: ~/.cabal
154 # Bump the key version to clear the cache
155 key: ${{ runner.os }}-${{ matrix.ghc_version }}-cabal-v1
157 - name: Download packcheck
158 run: |
159 # Get packcheck if needed
160 CURL=$(which curl)
161 PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
162 if test ! -e "$PACKCHECK_LOCAL_PATH"; then $CURL -sL -o "$PACKCHECK_LOCAL_PATH" $PACKCHECK_URL; fi;
163 chmod +x $PACKCHECK_LOCAL_PATH
165 - name: Run tests
166 run: |
167 if test -n "$DOCTEST"
168 then
169 mkdir -p $HOME/.cabal/bin
170 curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20210111/cabal-docspec-0.0.0.20210111.xz > cabal-docspec.xz
171 echo '0829bd034fba901cbcfe491d98ed8b28fd54f9cb5c91fa8e1ac62dc4413c9562 cabal-docspec.xz' | sha256sum -c -
172 xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec
173 rm -f cabal-docspec.xz
174 chmod a+x $HOME/.cabal/bin/cabal-docspec
175 cabal update
176 cabal build all
177 $HOME/.cabal/bin/cabal-docspec --version
178 $HOME/.cabal/bin/cabal-docspec --timeout 60 --check-properties --property-variables xs
179 elif test -z "$COVERAGE"
180 then
181 export TOOLS_DIR=/opt
182 # /usr/local/opt/curl/bin for macOS
183 export PATH=$HOME/.local/bin:$HOME/.ghcup/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/opt/curl/bin
184 bash -c "$PACKCHECK_LOCAL_PATH $BUILD"
185 fi
187 if test -n "$COVERAGE"
188 then
189 # Run tests with coverage
190 cabal update
191 # Build hpc-coveralls if needed
192 sudo apt-get install -y libcurl4-gnutls-dev
193 export PATH=$HOME/.cabal/bin:$PATH
194 which hpc-coveralls 2>/dev/null || cabal install --project-file cabal.project.hpc-coveralls hpc-coveralls
195 # Run tests and upload results to coveralls.io
196 bin/test.sh --coverage --raw
197 # XXX Uncomment this and fix it properly later
198 # hpc-coveralls --repo-token="$COVERALLS_TOKEN" --coverage-mode=StrictlyFullLines
199 fi