ci: add CI and GitHub Pages documentation workflows

This commit is contained in:
2026-10-23 16:38:24 +02:00
committed by owenrees
parent 786bad8956
commit 2bf11e92a8
16 changed files with 169 additions and 38 deletions
+49
View File
@@ -0,0 +1,49 @@
name: CI
on:
push:
pull_request:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Format, build, test, and document
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: 5.4.x
- name: Install dependencies
run: opam install . --deps-only --with-test --with-doc --with-dev-setup
- name: Check formatting
run: opam exec -- dune build @fmt
- name: Build
run: opam exec -- dune build @install
- name: Run tests
run: opam exec -- dune runtest
- name: Build documentation
run: opam exec -- dune build @doc
- name: Build the JavaScript artifact
run: opam exec -- dune build bin/pgn_to_tex_js.bc.js
- name: Run the Node smoke test
run: node test/js/smoke.js
- name: Lint the opam metadata
run: opam lint pgn_to_tex.opam
+58
View File
@@ -0,0 +1,58 @@
name: Documentation
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
name: Build odoc
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up OCaml
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: 5.4.x
- name: Install documentation dependencies
run: opam install . --deps-only --with-doc
- name: Build documentation
run: opam exec -- dune build @doc
- name: Disable Jekyll processing
run: touch _build/default/_doc/_html/.nojekyll
- name: Configure GitHub Pages
uses: actions/configure-pages@v5
- name: Upload the documentation artifact
uses: actions/upload-pages-artifact@v3
with:
path: _build/default/_doc/_html
deploy:
name: Deploy to GitHub Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4