-
Notifications
You must be signed in to change notification settings - Fork 26
96 lines (81 loc) · 2.29 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: build
on:
push:
branches:
- master
- do-ci
pull_request:
branches: '*'
jobs:
cabal:
name: ${{ matrix.os }} / GHC ${{ matrix.ghc }} / Cabal ${{ matrix.cabal }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
ghc:
- '8.4'
- '8.6'
- '8.8'
- '8.10'
cabal:
- 'latest'
- '2.4'
include:
- os: macos-latest
ghc: latest
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- uses: actions/cache@v2
with:
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ github.sha }}
path: ~/.cabal/store
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
- run: cabal v2-update
shell: bash
- run: cabal v2-configure --enable-tests --enable-benchmarks # NOTE: --enable-tests is necessary due to https://github.com/haskell/cabal/issues/5079
shell: bash
- run: cabal v2-build all
shell: bash
- run: cabal v2-test all
shell: bash
env:
HSPEC_OPTIONS: --color
stack:
strategy:
matrix:
resolver:
- 'lts-16'
- 'nightly'
name: ubuntu-latest / Stack ${{ matrix.resolver }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
with:
enable-stack: true
stack-version: latest
stack-no-global: true
- uses: actions/cache@v2
with:
key: ${{ runner.os }}-${{ matrix.resolver }}-${{ github.sha }}
path: ~/.stack
restore-keys: ${{ runner.os }}-${{ matrix.resolver }}-
- run: stack --resolver ${{ matrix.resolver }} test --bench --no-run-benchmarks --haddock --no-haddock-deps
shell: bash
env:
HSPEC_OPTIONS: --color
success:
needs:
- cabal
- stack
runs-on: ubuntu-latest
if: always() # this is required as GitHub considers "skipped" jobs as "passed" when checking branch protection rules
steps:
- run: false
if: needs.cabal.result != 'success' && needs.stack.result != 'success'