This repository has been archived by the owner on Oct 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
120 lines (105 loc) · 3.17 KB
/
haskell-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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: CI
on:
# Trigger the workflow on every pull request...
pull_request:
branches:
- master
# ...and when the main branch is updated.
push:
branches:
- master
# Build _at least_ once per month to actively check for regressions.
schedule:
- cron: '0 0 1 * *'
jobs:
cabal:
name: ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
# Not buildable ATM but it's good to keep an eye on it
continue-on-error: ${{ matrix.ghc == '9.0.1' }}
strategy:
matrix:
os:
- ubuntu-latest
# Check the last 3 (or so) major GHC releases; no need to waste compute.
ghc:
- 8.6.5
- 8.8.4
- 8.10.4
- 9.0.1
cabal:
- latest
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
id: setup-haskell-cabal
name: Setup Cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
# Regenerate the freeze file on each run to ensure that `cabal-install`
# always builds against the latest dependencies.
- name: Freeze
run: |
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
cabal freeze
- uses: actions/cache@v2
name: Cache Cabal Artifacts
with:
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-cabal-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: ${{ runner.os }}-cabal-${{ matrix.ghc }}-
- name: Build
run: |
cabal build all
- name: Test
run: |
cabal test all
- name: Generate Documentation
run: |
cabal haddock all
stack:
name: stack ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
name:
- nightly
- lts16
- lts17
include:
# Check that the build passes with the nightly snapshot.
- name: 'nightly'
stack_yaml: 'stack.yaml'
# Check that the build passes with the latest LTS snapshot.
- name: 'lts16'
stack_yaml: 'stack-lts16.yaml'
# Check that the build passes with the latest LTS snapshot.
- name: 'lts17'
stack_yaml: 'stack-lts17.yaml'
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
name: Cache Stack Artifacts
with:
path: |
~/.stack
.stack-work
key: ${{ runner.os }}-stack-${{ matrix.stack_yaml }}-${{ hashFiles(matrix.stack_yaml) }}
restore-keys: ${{ runner.os }}-stack-${{ matrix.stack_yaml }}-
- uses: haskell/actions/setup@v1
name: Stack Setup
with:
enable-stack: true
stack-no-global: true
stack-setup-ghc: true
- name: Build
run: |
stack --stack-yaml=${{ matrix.stack_yaml }} build --test --bench --no-run-tests --no-run-benchmarks
- name: Test
run: |
stack --stack-yaml=${{ matrix.stack_yaml }} test