-
Notifications
You must be signed in to change notification settings - Fork 4
101 lines (91 loc) · 2.96 KB
/
haskell.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
name: CI
# Trigger the workflow on push or pull request, but only for the master branch
on:
push:
branches:
- master
pull_request:
schedule:
- cron: '0 8 * * 3'
jobs:
stack:
name: ${{ matrix.os }} / ${{ matrix.snapshot }}
runs-on: ${{ matrix.os }}-latest
continue-on-error: ${{ matrix.snapshot == 'nightly' }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu
- macOS
- windows
snapshot:
- 'lts-12.11'
- 'lts-14.18'
- 'lts-16.12'
- 'lts-18.28'
- 'lts-19.33'
- 'lts-20.26'
- 'lts-21.25'
- 'lts-22.18'
- 'nightly'
exclude:
# github actions runs with arm for macos
#
# older versions of ghc support arm through llvm and the version that
# the machine uses is not compatible with ghc.
#
# So we exclude those builds
- snapshot: 'lts-12.11'
os: macOS
- snapshot: 'lts-14.18'
os: macOS
- snapshot: 'lts-16.12'
os: macOS
- snapshot: 'lts-18.28'
os: macOS
- snapshot: 'lts-19.33'
os: macOS
steps:
- uses: actions/checkout@main
- uses: haskell-actions/setup@main
name: Setup Haskell Stack
id: setuphaskell
with:
enable-stack: true
stack-no-global: true
- uses: actions/cache/restore@v4
name: Cache stack files
with:
path: ${{ steps.setuphaskell.outputs.stack-root }}
key: ${{ runner.os }}-${{ matrix.snapshot }}-stack2
- name: Setup stack.yaml
shell: bash
run: |
set -x
mv -vf "stack-ci.yaml" ./stack.yaml || true
mv -vf "stack-${{ matrix.snapshot }}.yaml" ./stack.yaml || true
mv -vf "stack-${{ matrix.snapshot }}-${{ matrix.os }}.yaml" ./stack.yaml || true
- name: Build and test
shell: bash
run: |
set -x
grep . stack.yaml
if grep SKIP stack.yaml; then
echo Skipped because that snapshot is broken
exit 0
fi
stack setup --resolver=${{ matrix.snapshot }}
echo "stack_root: ${{ steps.setuphaskell.outputs.stack-root }}"
stack --version
stack --resolver=${{ matrix.snapshot }} ghc -- --version
# we first build everything without running the tests (with unlimited parallelism)
stack build --resolver=${{ matrix.snapshot }} --ghc-options=-Werror --test --bench --no-run-tests
# once that's done we run the tests in a single threaded fashion to avoid
# https://github.com/commercialhaskell/stack/issues/5024#issuecomment-845001389
stack build --resolver=${{ matrix.snapshot }} --ghc-options=-Werror --test --bench -j 1
- uses: actions/cache/save@v4
if: always()
with:
path: ${{ steps.setuphaskell.outputs.stack-root }}
key: ${{ runner.os }}-${{ matrix.snapshot }}-stack2