-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (62 loc) · 2.42 KB
/
haskell-compile-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
name: Compile, Test, and Build Docs
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-18.04
strategy:
matrix:
ghc-ver: ["9.0.1"]
cabal-ver: ["3.4.0.0"]
steps:
- name: Checkout repo
uses: actions/[email protected]
# Install GHC & Cabal
- uses: actions/cache@v2
name: Cache cabal packages
id: cache-cabal
with:
path: |
~/.cabal/packages
~/.cabal/store
~/.cabal/bin
dist
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc-ver }}-${{ matrix.cabal-ver }}-${{ hashFiles('monus-weighted-search.cabal') }}-${{ hashFiles('**') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc-ver }}-${{ matrix.cabal-ver }}-${{ hashFiles('monus-weighted-search.cabal') }}-
${{ runner.os }}-${{ matrix.ghc-ver }}-${{ matrix.cabal-ver }}-
- name: Install ghc and cabal
uses: haskell/actions/[email protected]
with:
ghc-version: ${{ matrix.ghc-ver }}
cabal-version: ${{ matrix.cabal-ver }}
- name: Put cabal programs in PATH
run: echo "~/.cabal/bin" >> $GITHUB_PATH
- name: Install cabal-docspec
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20210111/cabal-docspec-0.0.0.20210111.xz > cabal-docspec.xz
echo '0829bd034fba901cbcfe491d98ed8b28fd54f9cb5c91fa8e1ac62dc4413c9562 cabal-docspec.xz' | sha256sum -c -
xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec
rm -f cabal-docspec.xz
chmod a+x $HOME/.cabal/bin/cabal-docspec
cabal-docspec --version
# Compile Local Haskell
- name: Build project
run: cabal v2-build all --enable-tests
- name: Run property tests
run: cabal test
- name: Run doctests
run: cabal-docspec --check-properties --property-variables n
- name: Generate haddocks
run: cabal new-haddock --haddock-hyperlink-source --haddock-html-location='https://hackage.haskell.org/package/$pkg-$version/docs' --enable-documentation
# Deploy Haskell docs to site
- name: Deploy haddocks to github pages
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist-newstyle/build/x86_64-linux/ghc-${{ matrix.ghc-ver }}/monus-weighted-search-0.2.0.0/opt/doc/html/monus-weighted-search
destination_dir: docs