-
Notifications
You must be signed in to change notification settings - Fork 18
65 lines (64 loc) · 2.07 KB
/
deploy.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
name: deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: checkout-submodules
run: |
git submodule update --init test/script/reference
git submodule update --init test/c/collections-c/files
- name: cache
id: cache-opam
uses: actions/cache@v4
env:
cache-name: cache-opam-deploy
with:
path: |
~/work/owi/owi/_opam/
key: ${{ runner.os }}-deploy-${{ env.cache-name }}-${{ hashFiles('**/*.opam') }}
- name: setup-ocaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "5.2"
dune-cache: true
opam-pin: true
allow-prerelease-opam: false
- name: depext
run: |
sudo apt update
opam install . --depext-only --with-test --with-doc
- name: setup-deploy
if: steps.cache-opam.outputs.cache-hit != 'true'
run: |
opam install . --deps-only --with-test --with-doc
opam install bisect_ppx z3 ocb
- name: api
run: |
touch doc/.nojekyll
opam exec -- dune build @doc
mv _build/default/_doc/_html doc/api
- name: coverage
run: |
BISECT_FILE=$(pwd)/bisect opam exec -- dune runtest --force --instrument-with bisect_ppx
opam exec -- bisect-ppx-report html -o doc/coverage
- name: coverage-badge
run: |
label=coverage
percentage=$(opam exec -- bisect-ppx-report summary | sed -E 's/.*\((..).*/\1/g')
color=$(printf "%x%x%x" $((255-$percentage)) $((155+$percentage)) 85)
opam exec -- ocb --style classic --label $label --status $percentage'%' --color $color > doc/coverage/badge.svg
- name: deploy
uses: JamesIves/github-pages-deploy-action@v4.6.3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: doc/
CLEAN: true