-
Notifications
You must be signed in to change notification settings - Fork 2
81 lines (67 loc) · 2.67 KB
/
force-run-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
on: [push]
name: nsc forced CI
jobs:
build:
runs-on: ubuntu-latest
name: Build nsc
if: "contains(toJSON(github.event.commits.*.message), '[force-run-ci]')" # if any commit contains "[force-run-ci]"
steps:
- name: Checkout
uses: actions/checkout@v2
# Setup cache
- name: Cache stack global package database
id: stack-global-package-db
uses: actions/cache@v2
continue-on-error: true
with:
path: ~/.stack
key: ${{ runner.os }}-stack-global-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-global
${{ runner.os }}-stack
- name: Cache stack-installed programs in ~/.local/bin
id: stack-programs
uses: actions/cache@v2
continue-on-error: true
with:
path: ~/.local/bin
key: ${{ runner.os }}-stack-programs-${{ hashFiles('**.yaml') }}
restore-keys: |
${{ runner.os }}-stack-programs
${{ runner.os }}-local-bin
- name: Cache **/.stack-work
id: stack-caches
uses: actions/cache@v2
continue-on-error: true
with:
path: |
.stack-work
lib/*/.stack-work
key: ${{ runner.os }}-stack-work-${{ hashFiles('**.yaml') }}
restore-keys: ${{ runner.os }}-stack-work
#############################################################################
- name: Install Stack
run: stack --version
- name: Install GHC
run: stack setup --install-ghc
- name: Install required tools
run: |
echo "::group::C2HS"
stack install c2hs
echo "PATH=~/.local/bin:$PATH" >> $GITHUB_ENV
echo "::end-group::"
echo "::group::glibc v2.31"
sudo apt-get install libc-dev
echo "::end-group::"
- name: Build Haskell dependencies
run: stack build --test --no-run-tests --only-dependencies --no-terminal
- name: Build NSC
id: build-nsc
run: stack build --test --no-run-tests --ghc-options=-fforce-recomp --ghc-options=-split-sections --ghc-options=-fdiagnostics-color=always
# --ghc-options=-fdefer-diagnostics
- name: Run tests
run: stack test
- name: Test doc generation
continue-on-error: true
if: steps.build-nsc.outcome == 'success' # it's useless to test doc generation if the code doesn't compile
run: stack build --haddock --no-haddock-deps --no-haddock-hyperlink-source --haddock-arguments="--no-print-missing-docs"