-
Notifications
You must be signed in to change notification settings - Fork 3
86 lines (64 loc) · 2.3 KB
/
ci.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
name: CI
on: push
permissions:
contents: read
jobs:
hlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: "Set up HLint"
uses: haskell-actions/hlint-setup@fe9cd1cd1af94a23900c06738e73f6ddb092966a
- name: "Run HLint"
uses: haskell-actions/hlint-run@eaca4cfbf4a69f4eb875df38b6bc3e1657020378
with:
path: '["app/", "src/", "test/"]'
fail-on: warning
fourmolu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: "Check formatting with Fourmolu"
uses: haskell-actions/run-fourmolu@3b7702b41516aa428dfe6e295dc73476ae58f69e
build-binary:
needs: hlint
runs-on: ubuntu-latest
env:
CONFIG: "--enable-tests --enable-benchmarks"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: haskell-actions/setup@dd344bc1cec854a369df8814ce17ef337d6e6170
id: setup-haskell-cabal
with:
ghc-version: "9.8"
cabal-version: "latest"
- name: Update Hackage snapshot
run: |
cabal update
cabal freeze $CONFIG
- name: Cache dependencies
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: |
${{ steps.setup-haskell-cabal.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ghc }}-
- name: Build dependencies
run: cabal build --only-dependencies $CONFIG
- name: Build application
run: cabal build $CONFIG all
- name: Run tests
run: cabal test $CONFIG all
- name: Generate documentation
run: cabal haddock $CONFIG all
- name: Install binary
run: cabal install --enable-executable-static --install-method=copy --overwrite-policy=always --installdir=dist/
- name: Rename binary
run: mv dist/eselsohr-exe dist/eselsohr
- name: Store application binary as artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882
with:
name: eselsohr
path: dist/eselsohr