-
Notifications
You must be signed in to change notification settings - Fork 42
114 lines (96 loc) · 2.96 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
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
name: CI
on:
# Build every pull request, to check for regressions.
pull_request:
types: [opened, synchronize]
# Build when a PR is merged, to update the README's CI badge.
push:
branches: [main]
# Build once a month, to detect missing upper bounds.
schedule:
- cron: '0 0 1 * *'
jobs:
# Check that the build passes with stack on all the provided snapshots, and
# thus all the supported ghc versions.
stack:
name: ${{ matrix.stack_yaml }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
stack_yaml:
- stack-8.6.5.yaml
- stack-8.8.4.yaml
- stack-8.10.7.yaml
- stack-9.0.2.yaml
- stack-9.2.7.yaml
- stack-9.4.5.yaml
- stack-9.6.1.yaml
os:
- ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
name: Cache Stack Artifacts
with:
path: |
~/.stack
.stack-work
key: ${{ runner.os }}-stack-${{ hashFiles(matrix.stack_yaml) }}
- uses: haskell/actions/setup@v2
id: setup-haskell-stack
name: Setup Stack
with:
enable-stack: true
stack-setup-ghc: true
stack-no-global: true
- name: Build
run: |
stack --stack-yaml=${{ matrix.stack_yaml }} install --test --bench --no-run-tests --no-run-benchmarks
- name: Test
run: |
stack --stack-yaml=${{ matrix.stack_yaml }} test
- name: Double-check the example file
run: |
stack --stack-yaml=${{ matrix.stack_yaml }} exec -- runghc examples/example.hs | diff examples/expected.txt -
# Check that the build passes with cabal with the latest version of our
# dependencies.
cabal:
name: newest
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- ghc: latest
os: ubuntu-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 }}
# This freeze file is regenerated on every build, so we will always test
# with the most recent version of our dependencies allowed by our upper
# bounds.
- name: Freeze
run: |
cabal v2-configure --enable-tests --enable-benchmarks --test-show-details=direct
cabal freeze
# Only reuse the cached copy of our dependencies if our freeze file matches
# the cache's copy.
- uses: actions/cache@v2
name: Cache Cabal Artifacts
with:
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-cabal-v2-${{ hashFiles('cabal.project.freeze') }}
- name: Build
run: |
cabal v2-build --enable-tests
- name: Test
run: |
cabal v2-test
- name: Double-check the example file
run: |
cabal v2-exec -- runghc examples/example.hs | diff examples/expected.txt -