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