Skip to content

Commit bf49c2d

Browse files
committed
CI: introduce a html generation action
1 parent a8aac90 commit bf49c2d

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
on:
2+
pull_request:
3+
4+
5+
jobs:
6+
generate-html-and-deploy:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Set the destination directory for PR event
10+
if: ${{ github.event_name == 'pull_request' }}
11+
run: echo "destination_dir=doc/pr/${{ github.head_ref }}" >> $GITHUB_ENV
12+
13+
- name: Setup Graphviz
14+
uses: ts-graphviz/setup-graphviz@v2
15+
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Coq
20+
uses: coq-community/docker-coq-action@v1
21+
with:
22+
opam_file: 'coq-mathcomp-analysis.opam'
23+
coq_version: 8.19
24+
ocaml_version: 4.14-flambda
25+
before_install: |
26+
opam repo add coq-extra-dev https://coq.inria.fr/opam/extra-dev
27+
opam update
28+
opam install -y coq-rocqnavi
29+
before_script: |
30+
startGroup "Workaround permission issue"
31+
sudo chown -R coq:coq .
32+
endGroup
33+
after_script: |
34+
mkdir -p html
35+
FILES=$(find . -name "*.v" -or -name "*.glob")
36+
coq2html -d html -title "MathComp-Analysis" -base mathcomp \
37+
-Q theories analysis -coqlib https://coq.inria.fr/doc/V8.19.0/stdlib/ \
38+
-external https://math-comp.github.io/htmldoc_2_1_0/ mathcomp.ssreflect \
39+
-external https://math-comp.github.io/htmldoc_2_1_0/ mathcomp.algebra \
40+
$FILES
41+
42+
- name: Deploy
43+
uses: peaceiris/actions-gh-pages@v4
44+
with:
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
publish_dir: html/
47+
destination_dir: ${{ env.destination_dir }}
48+
keep_files: true
49+
user_name: github-actions
50+
user_email: github-actions@github.com
51+
52+
- name: Set URL of the Html doc
53+
run: echo "doc_url=https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ env.destination_dir }}" >> $GITHUB_ENV
54+
- name: Feedback as a PR comment
55+
if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }}
56+
run: |
57+
gh pr comment ${{ github.event.number }} --body "The HTML Documentation was generated by Rocqnavi: ${{ env.doc_url }}"
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)