-
Notifications
You must be signed in to change notification settings - Fork 93
87 lines (76 loc) · 2.4 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
name: Build
on:
- push
- pull_request
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
ocaml-compiler:
- "4.02"
- "4.04"
- "4.06"
- "4.08"
- "4.10"
- "4.12"
- "4.14"
- "5.0"
- "5.2"
include:
- os: ubuntu-latest
ocaml-compiler: "5.2"
# We don't need to compute coverage for more than one build
send-coverage: true
# Mdx tests Mdx tests
run-mdx: true
test-sherlodoc: true
- os: macos-latest
ocaml-compiler: "5.2"
# - os: windows-latest
# ocaml-compiler: "5.2"
runs-on: ${{ matrix.os }}
steps:
- name: Set git to use LF
if: runner.os == 'Windows'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout tree
uses: actions/checkout@v4
- name: Set-up OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
# Do not pin odoc to not break Mdx installation
opam-pin: ${{ matrix.run-mdx != true }}
- name: Install dependencies
run: |
opam install --deps-only --with-test ./odoc.opam ./odoc-parser.opam \
${{ matrix.test-sherlodoc && './sherlodoc.opam' }}
- name: dune runtest
if: matrix.test-sherlodoc == true
# Run all tests
run: opam exec -- dune runtest
- name: dune runtest
if: matrix.test-sherlodoc != true
# Run the tests for odoc and odoc-parser only
run: opam exec -- dune runtest -p odoc,odoc-parser
- name: Mdx tests
if: matrix.run-mdx == true
run: |
opam install mdx
opam exec -- dune build @runmdx
- name: Send coverage stats to Coveralls
if: matrix.send-coverage == true
run: |
opam install bisect_ppx
mkdir -p $BISECT_FILE
opam exec -- dune runtest --instrument-with bisect_ppx --force
opam exec -- bisect-ppx-report send-to Coveralls --coverage-path /tmp/coverage
env:
BISECT_FILE: /tmp/coverage/bisect
COVERALLS_REPO_TOKEN: ${{ github.token }}
PULL_REQUEST_NUMBER: ${{ github.event.number }}