-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (57 loc) · 1.63 KB
/
main.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
name: "build and test"
on:
push:
branches:
- "main"
paths:
- "lib/**"
- "test/**"
- "doc/**"
workflow_dispatch:
# schedule:
# # Prime the caches every Monday
# - cron: 0 1 * * MON
# permissions: "read-all"
permissions:
contents: "write"
pages: "write"
id-token: "write"
jobs:
build-and-test:
runs-on: "ubuntu-latest"
steps:
- name: "checkout"
uses: "actions/checkout@v4"
- name: "setup ocaml"
uses: "ocaml/setup-ocaml@v2"
with:
ocaml-compiler: "5.0"
dune-cache: true
- name: "opam eval"
run: "eval $(opam env)"
- name: "install dependencies"
run: "opam install . --deps-only --with-test"
- name: "build"
run: "opam exec -- dune build"
- name: "test and coverage"
run: "opam exec -- dune runtest --instrument-with bisect_ppx --force"
- name: "coverage report"
run: "opam exec -- bisect-ppx-report summary"
- name: "install global dependencies"
run: "opam install odoc"
- name: "build docs"
run: "opam exec -- dune build @doc"
- name: "upload docs"
uses: "actions/upload-artifact@v3.1.3"
with:
name: "docs"
path: "_build/default/_doc/_html"
- name: "deploy docs"
uses: "peaceiris/actions-gh-pages@v3"
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
publish_dir: "_build/default/_doc/_html"
destination_dir: "docs"
enable_jekyll: true