-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (74 loc) · 2.21 KB
/
main.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
on: [push]
name: Build and test
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Check out
uses: actions/checkout@v2
- name: Cache GHC installation
uses: actions/cache@v4
id: ghcup
with:
path: |
~/.ghcup/bin/*
~/.ghcup/cache/*
~/.ghcup/config.yaml
~/.ghcup/ghc/*
key: CI-ghcup
- name: Setup Haskell
uses: haskell/actions/setup@v2
if: steps.ghcup.outputs.cache-hit != 'true'
with:
enable-stack: true
- name: Cache Stackage package index
id: pantry
uses: actions/cache@v4
with:
path: ~/.stack/pantry
key: CI-pantry-${{ env.STACK_LTS }}
- name: Recompute Stackage package index
if: steps.pantry.outputs.cache-hit != 'true'
run: stack update
- name: Cache Haskell dependencies
uses: actions/cache@v3
with:
path: |
~/.stack/stack.sqlite3
~/.stack/snapshots
key: CI-testdeps--${{ env.STACK_LTS }}--${{ hashFiles('stack.yaml.lock') }}
restore-keys: |
CI-testdeps--${{ env.STACK_LTS }}--
CI-testdeps--
- name: Cache Haskell project buildstate
uses: actions/cache@v4
with:
path: .stack-work
key: CI-builddir--${{ env.GHC_VERSION }}
- name: Build package dependencies
run: |
stack build --no-run-tests --no-run-benchmarks --only-dependencies
- name: Build package
run: |
stack build --no-run-tests --no-run-benchmarks
- name: Build testing dependencies
run: |
stack build --no-run-tests --no-run-benchmarks --test --bench
- name: Run tests
run: |
stack build --test --no-run-benchmarks
- name: Build documentation
run: |
stack haddock
- name: Check documentation
run: |
stack install doctest
$(stack path --local-bin)/doctest src/
- name: Deploy
run: |
stack path --local-install-root