Skip to content

[pre-commit.ci] pre-commit autoupdate #98

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #98

Workflow file for this run

name: ci
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
tests:
name: "Tests"
runs-on: ubuntu-latest
if: ${{ !github.event.pull_request.head.repo.fork }}
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
pytest_opts: ["--workers 4 --tests-per-worker 1"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --with=test,dev
- name: Run tests
run: poetry run pytest tests/
build-docs:
name: "Build Docs"
runs-on: ubuntu-latest
needs: ["tests"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: extractions/setup-just@v1
- uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install --with=test,dev
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Build docs
run: |
just render
- name: Save docs artifact
uses: actions/upload-artifact@v4
with:
name: docs-html
path: docs/_site
publish-docs:
name: "Publish Docs"
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
needs: ["build-docs", "tests"]
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/download-artifact@v4
with:
name: docs-html
path: docs/_site
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site