Clippy #110
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Based on https://github.com/mitmproxy/pdoc/blob/main/.github/workflows/docs.yml | |
name: website | |
# build the documentation whenever there are new changes on main | |
on: | |
push: | |
branches: | |
- main | |
# security: restrict permissions for CI jobs. | |
permissions: | |
contents: read | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_LOG: debug | |
MATURIN_VERSION: '1.7.4' | |
RUST_TOOLCHAIN: nightly-2024-10-28 | |
jobs: | |
# Build the documentation and upload the static HTML files as an artifact. | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
python -m venv .venv | |
source .venv/bin/activate | |
pip install --upgrade pip | |
pip install "maturin[patchelf]"==${{ env.MATURIN_VERSION }} | |
pip install -r tests/requirements.txt | |
pip install pdoc | |
working-directory: ./py_chrontext | |
- name: Set up nightly rust | |
run: | | |
rustup toolchain install ${{ env.RUST_TOOLCHAIN }} | |
rustup default ${{ env.RUST_TOOLCHAIN }} | |
- name: Build install package and build docs | |
run: | | |
source .venv/bin/activate | |
maturin develop --features=opcua | |
pdoc -o docs/ chrontext | |
working-directory: ./py_chrontext | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
path: py_chrontext/docs/ | |
# Deploy the artifact to GitHub pages. | |
# This is a separate job so that only actions/deploy-pages has the necessary permissions. | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- id: deployment | |
uses: actions/deploy-pages@v4 |