Skip to content

feat: add .readthedocs.yaml (#218) #358

feat: add .readthedocs.yaml (#218)

feat: add .readthedocs.yaml (#218) #358

Workflow file for this run

name: main
on:
push:
branches:
- main
pull_request:
paths:
- "**.py"
- pyproject.toml
- ".github/workflows/main.yml"
- ".pre-commit-config.yaml"
- "!docs/**"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- run: pip install -r requirements-dev.txt
- name: Run pre-commit
run: |
nox -s lint
nox -s test-hook
- name: Build wheel
run: nox -s build
- name: Upload wheel as artifact
uses: actions/upload-artifact@v4
with:
name: commit-check_wheel
path: ${{ github.workspace }}/dist/*.whl
- name: Run commit-check
run: nox -s commit-check
- name: Collect Coverage
run: nox -s coverage
- uses: codecov/codecov-action@v5.0.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
install:
needs: [build]
strategy:
fail-fast: false
matrix:
py: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
os: ['windows-latest', 'ubuntu-24.04', 'macos-latest']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- run: |
pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Download wheel artifact
uses: actions/download-artifact@v4
with:
name: commit-check_wheel
path: dist
- name: Install test
# using a wildcard as filename on Windows requires a bash shell
shell: bash
run: nox -s install-wheel
docs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }} # get current branch name
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: pip install -r requirements-dev.txt
- name: Build docs
run: nox -s docs
- name: Save built docs as artifact
uses: actions/upload-artifact@v4
with:
name: "commit-check_docs"
path: ${{ github.workspace }}/_build/html
- name: Upload docs to github pages
# only publish doc changes from main branch
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build/html