Skip to content

Commit

Permalink
test(ci): doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziqi-Yang committed Jul 31, 2024
1 parent 5878e57 commit b7cd326
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 2 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/sphinx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: "Deploy docs to Pages"

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:


# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run
# in-progress and latest queued. However, do NOT cancel in-progress runs as we
# want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'

- name: setup virtual env
run: |
python -m venv .venv
pip install -r requirements.txt
- name: Install dependencies
run: |
bash ./scripts/action/install_llvm.sh
# this will generate stub files(.phi), which is what we need
- name: Build
run: |
. ./.venv/bin/activate
pip install .
- name: Build HTML Doc
uses: ammaraskar/sphinx-action@master

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/build/html/

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 1 addition & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ install-normal:
pip install .

install-dev-requirements:
pip install nanobind scikit-build-core[pyproject] pytest build cibuildwheel \
sphinx furo sphinx-autoapi
pip install -r ./requirements.txt

build-docs:
cd ./docs && make html
Expand Down
18 changes: 18 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Development requirements

# Build
build==1.2.1
cibuildwheel==2.19.2
nanobind==2.0.0
scikit-build-core[pyproject]==0.9.9

# Test
pytest==8.3.2

# Doc
sphinx==7.4.7
furo==2024.7.18
sphinx-autoapi==3.2.1

# Misc
twine==5.1.1

0 comments on commit b7cd326

Please sign in to comment.