Skip to content

Commit

Permalink
Use our own python setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Halbaroth committed Jul 22, 2024
1 parent 1218474 commit 6371eb2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 25 deletions.
27 changes: 6 additions & 21 deletions .github/workflows/build_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,11 @@ jobs:
ocaml-compiler: ${{ env.OCAML_DEFAULT_VERSION }}
dune-cache: true

- name: Install dependencies
run: opam exec -- make deps

- name: Build odoc documentation
run: opam exec -- dune build @doc

- name: Build sphinx documentation
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/sphinx_docs/"
build-command: "sphinx-build . -W -b html ../../_build/sphinx_docs"
- name: Setup python
uses: actions/setup-python@v5

- name: Upload odoc artifact
uses: actions/upload-artifact@v4
with:
name: odoc-artifact
path: _build/default/_doc/_html
- name: Install dependencies
run: opam exec -- make doc-deps

- name: Upload sphinx artifact
uses: actions/upload-artifact@v4
with:
name: sphinx-artifact
path: _build/sphinx_docs
- name: Build documentation
run: opam exec -- make doc
6 changes: 4 additions & 2 deletions .github/workflows/deploy_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ on:
jobs:
deploy:
steps:
- name: Download artifact
- name: Download odoc artifact
uses: actions/download-artifact@v4
with:
name: doc-artifact
name: odoc-artifact
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Down

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ __pycache__

# Generated nix files
/result*

# Virtual environment to build sphinx docs
sphinx-venv
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ DUNE=dune
DUNE_FLAGS?=

# Definining the sphinx build command
SPHINXBUILD = sphinx-build
SPHINXBUILD = sphinx-venv/bin/sphinx-build

# List the files:
# - generated by rules in this makefile,
Expand Down Expand Up @@ -243,6 +243,14 @@ js-deps:
'zarith_stubs_js>=v0.16.1' \
lwt_ppx -y

doc-deps: dev-switch
python -m venv sphinx-venv
sphinx-venv/bin/pip install \
sphinx \
sphinx-rtd-theme \
sphinx-markdown-tables \
myst-parser

deps:
opam install -y . --locked --deps-only

Expand All @@ -252,7 +260,7 @@ test-deps:
dune-deps:
dune-deps . | dot -Tpng -o docs/deps.png

.PHONY: archi deps test-deps dune-deps dev-switch lock
.PHONY: archi deps doc-deps test-deps dune-deps dev-switch lock

# ===============
# PUBLIC RELEASES
Expand Down

0 comments on commit 6371eb2

Please sign in to comment.