on 9119e44 help sign in
182 lines 6.6 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.0.1
55 - 8.10.4+stack
56 - 8.10.4+macOS
57 - 8.10.4+linux+coverage+cabal
58 - 8.10.4+docspec
59 - 8.8.4
60 - 8.8.4+inspection+fusion-plugin+Werror
61 - 8.6.5+fusion-plugin
62 - 8.6.5+streamk
63 - 8.4.4+debug
64 cabal_version: ["3.4"]
65 include:
66 - name: 9.0.1
67 ghc_version: 9.0.1
68 build: cabal-v2
69 cabal_build_options: "--allow-newer=hsc2hs"
70 disable_sdist_build: "y"
71 runner: ubuntu-latest
72 - name: 8.10.4+stack
73 build: stack
74 resolver: lts-18.0
75 stack_yaml: stack.yaml
76 sdist_options: "--ignore-check"
77 stack_build_options: "--flag streamly-benchmarks:-opt"
78 runner: ubuntu-latest
79 - name: 8.10.4+macOS
80 ghc_version: 8.10.4
81 build: cabal-v2
82 disable_sdist_build: "y"
83 runner: macos-latest
84 - name: 8.10.4+linux+coverage+cabal
85 ghc_version: 8.10.4
86 coverage: "y"
87 runner: ubuntu-latest
88 - name: 8.8.4+inspection+fusion-plugin+Werror
89 ghc_version: 8.8.4
90 build: cabal-v2
91 cabal_project: cabal.project.Werror
92 cabal_build_options: "--flag fusion-plugin --flag inspection"
93 runner: ubuntu-latest
94 - name: 8.8.4
95 ghc_version: 8.8.4
96 build: cabal
97 cabal_project: cabal.project
98 cabal_build_options: "--flag -opt"
99 runner: ubuntu-latest
100 - name: 8.6.5+streamk
101 ghc_version: 8.6.5
102 build: cabal-v2
103 cabal_project: cabal.project
104 cabal_build_options: "--flag streamk --flag -opt"
105 runner: ubuntu-latest
106 - name: 8.6.5+fusion-plugin
107 ghc_version: 8.6.5
108 build: cabal-v2
109 cabal_project: cabal.project
110 cabal_build_options: "--flag fusion-plugin"
111 # haddock generation does not work with 8.6.5+fusion-plugin
112 disable_docs: "y"
113 runner: ubuntu-latest
114 - name: 8.4.4+debug
115 ghc_version: 8.4.4
116 build: cabal-v2
117 cabal_project: cabal.project
118 cabal_build_options: "--flag debug --flag -opt"
119 runner: ubuntu-latest
120 - name: 8.10.4+docspec
121 ghc_version: 8.10.4
122 doctest: "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 -n "$DOCTEST"
151 then
152 mkdir -p $HOME/.cabal/bin
153 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
154 echo '0829bd034fba901cbcfe491d98ed8b28fd54f9cb5c91fa8e1ac62dc4413c9562 cabal-docspec.xz' | sha256sum -c -
155 xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec
156 rm -f cabal-docspec.xz
157 chmod a+x $HOME/.cabal/bin/cabal-docspec
158 cabal update
159 cabal build all
160 $HOME/.cabal/bin/cabal-docspec --version
161 $HOME/.cabal/bin/cabal-docspec --timeout 60 --check-properties --property-variables xs
162 elif test -z "$COVERAGE"
163 then
164 export TOOLS_DIR=/opt
165 # /usr/local/opt/curl/bin for macOS
166 export PATH=$HOME/.local/bin:$HOME/.ghcup/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/opt/curl/bin
167 bash -c "$PACKCHECK_LOCAL_PATH $BUILD"
168 fi
170 if test -n "$COVERAGE"
171 then
172 # Run tests with coverage
173 cabal update
174 # Build hpc-coveralls if needed
175 sudo apt-get install -y libcurl4-gnutls-dev
176 export PATH=$HOME/.cabal/bin:$PATH
177 which hpc-coveralls 2>/dev/null || cabal install --project-file cabal.project.hpc-coveralls hpc-coveralls
178 # Run tests and upload results to coveralls.io
179 bin/test.sh --coverage --raw
180 # XXX Uncomment this and fix it properly later
181 # hpc-coveralls --repo-token="$COVERALLS_TOKEN" --coverage-mode=StrictlyFullLines
182 fi