-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (64 loc) · 1.96 KB
/
build-and-test.yaml
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
on:
workflow_call:
jobs:
pedantic-build:
name: Pedantic build
runs-on: ubuntu-latest
steps:
- name: Clone project
uses: actions/checkout@v4
- name: Setup Haskell with Stack
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-version: "latest"
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.stack
key: pedantic-${{ hashFiles('stack.yaml') }}
restore-keys: |
pedantic-
- name: Install dependencies
run: |
stack update
stack build --only-dependencies
- name: Pedantic build
run: |
stack build --pedantic
build-and-test:
name: Build and Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
- name: Clone project
uses: actions/checkout@v4
- name: Setup Haskell with Stack
uses: haskell-actions/setup@v2
with:
enable-stack: true
stack-version: "latest"
- name: Cache dependencies on Unix-like OS
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}
- name: Cache dependencies on Windows
if: startsWith(runner.os, 'Windows')
uses: actions/cache@v4
with:
path: |
~\AppData\Roaming\stack
~\AppData\Local\Programs\stack
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}
- name: Install dependencies
run: |
stack update
stack build --only-dependencies --test --bench --no-run-tests --no-run-benchmarks
- name: Build
run: stack build --test --bench --no-run-tests --no-run-benchmarks
- name: Run tests
run: stack test