-
Notifications
You must be signed in to change notification settings - Fork 26
56 lines (46 loc) · 1.41 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
name: Haskell CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Cache Key
id: cache_key
run: echo ::set-output name=key::$(md5sum stack.yaml | awk '{print $1}')
- name: Cache Dependencies
id: cache
uses: actions/cache@v1
with:
path: ~/.stack
key: ${{ matrix.os }}-${{ steps.cache_key.outputs.key }}
- name: Build Snapshot
if: steps.cache.outputs.cache-hit != 'true'
run: |
stack --no-terminal test --bench --only-snapshot
- name: Build & Test
run: |
stack --no-terminal test --bench --no-run-benchmarks --haddock --no-haddock-deps
stack install
cp $HOME/.local/bin/mqtt-watch .
PKG_NAME=$(cat *.cabal | grep "name:" | sed "s/name:\s*\(.*\)/\1/")
mkdir -p dist/ && mv $(stack path --local-install-root)/doc/$PKG_NAME-*/* dist/
- name: Store Artifact
uses: actions/upload-artifact@v1
with:
name: mqtt-watch-${{ matrix.os }}
path: mqtt-watch
- name: Publish Docs
if: matrix.os == 'ubuntu-latest' && github.event_name == 'push'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist
enable_jekyll: false