-
Notifications
You must be signed in to change notification settings - Fork 7
63 lines (52 loc) · 1.82 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
name: Haskell CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
env:
cache-name: cache-stack
with:
path: ~/.stack
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.stack') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Stack
uses: freckle/stack-action@v4
with:
test: true
# Too pedantic: enables -Werror and warnings that we don’t want (e.g.
# incomplete uni patterns)
pedantic: false
# Instead, add only -Werror
stack-arguments: --ghc-options -Werror
- name: "Haddock: build"
# Not sure why it’s not $(stack path --local-doc-root) but the generated
# directory isn’t right, reproducible locally. Haddock reports
# a different one at the end of its run, and *that* is where the
# documentation is.
run: |
stack haddock --fast --test --no-run-tests --no-haddock-deps
echo "haddock_files=$(stack path --local-install-root)/doc/" >> "$GITHUB_ENV"
echo "stack path --local-install-root: $(stack path --local-install-root)"
- name: "Haddock: package"
uses: actions/upload-pages-artifact@v1 # This will automatically upload an artifact from the '/_site' directory
with:
path: ${{ env.haddock_files }}
- name: "Haddock: deploy"
if: github.ref == 'refs/heads/master'
uses: actions/deploy-pages@main