-
Notifications
You must be signed in to change notification settings - Fork 6
80 lines (64 loc) · 1.76 KB
/
ci.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
name: CI Pipeline
on:
push:
pull_request:
types:
- opened
- synchronize
jobs:
cabal:
name: GHC ${{ matrix.ghc }} (${{ matrix.os }})
strategy:
matrix:
os: [ ubuntu-latest, macOS-latest ]
ghc: [ 8.0.2, 8.2.2, 8.4.4, 8.6.5, 8.8.3, 8.10.2, 9.0.1 ]
include:
- os: ubuntu-20.04
ghc: 8.0.2
- os: ubuntu-20.04
ghc: 8.2.2
exclude:
- os: macOS-latest
ghc: 8.0.2
- os: macOS-latest
ghc: 8.2.2
- os: macOS-latest
ghc: 8.4.4
env:
ARGS: --enable-tests --enable-benchmarks
runs-on: ${{ matrix.os }}
steps:
- name: Environment
run: |
echo "matrix=${{ toJSON(matrix) }}"
echo "ARGS=$ARGS"
- name: Checkout
uses: actions/checkout@v2
- name: Setup Haskell
uses: haskell/actions/setup@v1
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
- name: Cabal Update
run: cabal update
- name: Cabal Freeze
run: cabal freeze $ARGS
- name: Cache
uses: actions/cache@v2
with:
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-
- name: Build Dependencies
run: cabal build $ARGS --only-dependencies
- name: Build Project
run: cabal build $ARGS
- name: Run Tests
run: cabal test $ARGS
- name: Generate Documentation
run: cabal haddock $ARGS
- name: Package Distribution
run: cabal sdist