on aaa775b help sign in
228 lines 8.4 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_BENCH: ${{ matrix.disable_bench }}
20 DISABLE_DIST_CHECKS: ${{ matrix.disable_dist_checks }}
21 SDIST_OPTIONS: ${{ matrix.sdist_options }}
22 DISABLE_SDIST_BUILD: ${{ matrix.disable_sdist_build }}
24 # Cabal options
25 CABAL_REINIT_CONFIG: y
26 # Github has machines with 2 CPUS and 6GB memory so the cabal jobs
27 # default (ncpus) is good, this can be checked from the packcheck
28 # output in case it changes.
29 CABAL_BUILD_OPTIONS: ${{ matrix.cabal_build_options }} --flag limit-build-mem
30 CABAL_BUILD_TARGETS: ${{ matrix.cabal_build_targets }}
31 CABAL_PROJECT: ${{ matrix.cabal_project }}
32 CABAL_CHECK_RELAX: y
34 # Stack options
35 STACK_UPGRADE: "y"
36 RESOLVER: ${{ matrix.resolver }}
37 STACK_YAML: ${{ matrix.stack_yaml }}
38 STACK_BUILD_OPTIONS: ${{ matrix.stack_build_options }}
40 # packcheck location and revision
41 PACKCHECK_LOCAL_PATH: "./packcheck.sh"
42 PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
43 PACKCHECK_GITHUB_COMMIT: "075e13ab716c67d2110db4905ae42b0280af046d"
45 # Pull token from "secrets" setting of the github repo
46 COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
47 COVERAGE: ${{ matrix.coverage }}
48 DOCTEST: ${{ matrix.doctest }}
50 runs-on: ${{ matrix.runner }}
51 continue-on-error: ${{ matrix.ignore_error }}
52 strategy:
53 fail-fast: true
54 matrix:
55 # The order is important to optimize fail-fast.
56 name:
57 - 8.10.7-sdist-fusion-inspection-Werror
58 - 9.2.2-docspec
59 # - 8.10.7-coverage
61 # Note: if cabal.project is not specified benchmarks and tests won't
62 # run. But we need at least one test where we test without
63 # cabal.project because that is how hackage would build it.
64 include:
65 - name: head
66 ghc_version: head
67 runner: ubuntu-latest
68 build: cabal
69 cabal_version: latest
70 cabal_project: cabal.project.ghc-head
71 disable_sdist_build: "y"
72 ignore_error: true
73 - name: 9.2.2
74 ghc_version: 9.2.2
75 runner: ubuntu-latest
76 build: cabal
77 cabal_project: cabal.project
78 cabal_version: 3.6
79 disable_sdist_build: "y"
80 ignore_error: false
81 - name: 9.2.2-docspec
82 ghc_version: 9.2.2
83 runner: ubuntu-latest
84 doctest: "y"
85 cabal_version: 3.6
86 cabal_project: cabal.project
87 ignore_error: false
88 - name: 9.0.2
89 ghc_version: 9.0.2
90 runner: ubuntu-latest
91 build: cabal
92 cabal_version: 3.6
93 cabal_project: cabal.project
94 disable_sdist_build: "y"
95 ignore_error: true
96 - name: 8.10.7-sdist-stack
97 runner: ubuntu-latest
98 build: stack
99 resolver: lts-18.23
100 stack_yaml: stack.yaml
101 sdist_options: "--ignore-check"
102 stack_build_options: "--flag streamly-benchmarks:-opt"
103 cabal_version: 3.6
104 ignore_error: false
105 - name: 8.10.7-macos
106 ghc_version: 8.10.7
107 runner: macos-latest
108 build: cabal
109 cabal_version: 3.6
110 cabal_project: cabal.project
111 disable_sdist_build: "y"
112 ignore_error: false
113 # - name: 8.10.7-coverage
114 # ghc_version: 8.10.7
115 # runner: ubuntu-latest
116 # coverage: "y"
117 # cabal_version: 3.6
118 # ignore_error: false
119 - name: 8.10.7-sdist-fusion-inspection-Werror
120 ghc_version: 8.10.7
121 runner: ubuntu-latest
122 build: cabal
123 cabal_version: 3.6
124 cabal_project: cabal.project.Werror
125 cabal_build_options: "--flag fusion-plugin --flag inspection"
126 ignore_error: false
127 - name: 8.8.4-sdist-fusion
128 ghc_version: 8.8.4
129 runner: ubuntu-latest
130 build: cabal
131 cabal_version: 3.6
132 cabal_project: cabal.project
133 cabal_build_options: "--flag fusion-plugin"
134 ignore_error: false
135 - name: 8.6.5-sdist-streamk-unoptimized
136 ghc_version: 8.6.5
137 runner: ubuntu-latest
138 build: cabal
139 cabal_version: 3.6
140 cabal_project: cabal.project
141 cabal_build_options: "--flag streamk --flag -opt"
142 ignore_error: false
143 - name: 8.6.5-sdist-debug-unoptimized
144 ghc_version: 8.6.5
145 runner: ubuntu-latest
146 build: cabal
147 cabal_version: 3.6
148 cabal_project: cabal.project
149 cabal_build_options: "--flag debug --flag -opt"
150 ignore_error: false
151 - name: 8.4.4-sdist
152 ghc_version: 8.4.4
153 runner: ubuntu-latest
154 build: cabal
155 cabal_version: 3.6
156 cabal_project: cabal.project
157 ignore_error: false
159 steps:
160 - uses: actions/checkout@v2
162 - uses: actions/cache@v1
163 name: Cache ~/.cabal
164 with:
165 path: ~/.cabal
166 # Bump the key version to clear the cache
167 key: ${{ runner.os }}-${{ matrix.ghc_version }}-cabal-v1
169 - name: Download packcheck
170 run: |
171 # Get packcheck if needed
172 CURL=$(which curl)
173 PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
174 if test ! -e "$PACKCHECK_LOCAL_PATH"; then $CURL -sL -o "$PACKCHECK_LOCAL_PATH" $PACKCHECK_URL; fi;
175 chmod +x $PACKCHECK_LOCAL_PATH
177 os=$(uname -s -m)
178 case "$os" in
179 "Linux x86_64") GHCUP_ARCH="x86_64-linux" ;;
180 "Darwin x86_64") GHCUP_ARCH="x86_64-apple-darwin" ;;
181 *) echo "Unknown OS/Arch: $os"; exit 1;;
182 esac
184 $CURL -sL -o ./ghcup https://downloads.haskell.org/~ghcup/0.1.17.4/${GHCUP_ARCH}-ghcup-0.1.17.4
185 chmod +x ./ghcup
186 if test "$GHCVER" = "head"
187 then
188 ./ghcup install ghc -u https://gitlab.haskell.org/ghc/ghc/-/jobs/artifacts/master/raw/ghc-x86_64-deb10-linux-integer-simple.tar.xz?job=validate-x86_64-linux-deb10-integer-simple head
189 else
190 ./ghcup install ghc $GHCVER
191 fi
192 ./ghcup set ghc $GHCVER
194 - name: Run tests
195 run: |
196 if test -n "$DOCTEST"
197 then
198 mkdir -p $HOME/.cabal/bin
199 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
200 echo '0829bd034fba901cbcfe491d98ed8b28fd54f9cb5c91fa8e1ac62dc4413c9562 cabal-docspec.xz' | sha256sum -c -
201 xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec
202 rm -f cabal-docspec.xz
203 chmod a+x $HOME/.cabal/bin/cabal-docspec
204 cabal update
205 cabal build all
206 $HOME/.cabal/bin/cabal-docspec --version
207 $HOME/.cabal/bin/cabal-docspec --timeout 60 --check-properties --property-variables xs
208 elif test -z "$COVERAGE"
209 then
210 export TOOLS_DIR=/opt
211 # /usr/local/opt/curl/bin for macOS
212 export PATH=$HOME/.local/bin:$HOME/.ghcup/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/opt/curl/bin
213 bash -c "$PACKCHECK_LOCAL_PATH $BUILD"
214 fi
216 if test -n "$COVERAGE"
217 then
218 # Run tests with coverage
219 cabal update
220 # Build hpc-coveralls if needed
221 sudo apt-get install -y libcurl4-gnutls-dev
222 export PATH=$HOME/.cabal/bin:$PATH
223 which hpc-coveralls 2>/dev/null || cabal install --project-file cabal.project.hpc-coveralls hpc-coveralls
224 # Run tests and upload results to coveralls.io
225 bin/test.sh --coverage --raw
226 # XXX Uncomment this and fix it properly later
227 # hpc-coveralls --repo-token="$COVERALLS_TOKEN" --coverage-mode=StrictlyFullLines
228 fi