-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (90 loc) · 2.35 KB
/
build.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# From https://github.com/jonathanknowles/haskell-example
on:
workflow_dispatch:
pull_request:
types:
- synchronize
- opened
- reopened
push:
branches:
- main
schedule:
# Run once per day (at UTC 00:00) to maintain cache:
- cron: 0 0 * * *
jobs:
build:
name: ${{ matrix.os }}-ghc-${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
cabal:
- 3.6.2.0
ghc:
- 8.10.7
- 9.0.2
- 9.2.2
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Environment
uses: haskell/actions/[email protected]
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Configure
run: >
cabal configure
--enable-tests
--enable-benchmarks
--enable-documentation
--test-show-details=direct
--write-ghc-environment-files=always
- name: Freeze
run: |
cabal freeze
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: |
${{ runner.os }}-\
${{ matrix.ghc }}-\
${{ hashFiles('cabal.project.freeze') }}
- name: Dependencies
run: |
ghc --version
cabal --version
cabal build all --only-dependencies
- name: Build
run: |
cabal build all
- name: Test
run: |
cabal test all
- name: Documentation
if: |
matrix.os == 'ubuntu-latest'
&& matrix.ghc == '8.10.7'
run: >
cabal haddock
--haddock-hyperlink-source
--haddock-quickjump
--haddock-html-location
'https://hackage.haskell.org/package/$pkg-$version/docs'
mv dist-newstyle/build/*/*/*/doc/html/* gh-pages
touch gh-pages/.nojekyll
- name: Deploy
if: |
github.ref == 'refs/heads/main'
&& matrix.os == 'ubuntu-latest'
&& matrix.ghc == '8.10.7'
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: gh-pages