Skip to content

[MNT] add Dockerfile + use image for CI/CD #21

[MNT] add Dockerfile + use image for CI/CD

[MNT] add Dockerfile + use image for CI/CD #21

Workflow file for this run

name: Documentation
on:
push:
branches:
- main
- dev
paths:
- 'docs/**'
- 'src/**'
- '.github/workflows/docs.yml'
pull_request:
branches:
- main
- dev
paths:
- 'docs/**'
- 'src/**'
- '.github/workflows/docs.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-snippets:
name: test-doc-snippets
runs-on: ubuntu-latest
container:
image: ghcr.io/hyperactive-project/hyperactive-ci:py${{ matrix.python-version }}
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Install package and docs requirements
run: |
pip install --no-cache-dir -e ".[all_extras,test]"
pip install --no-cache-dir -r docs/requirements.txt
- name: Show dependencies
run: python -m pip list
- name: Test documentation snippets
run: |
python -m pytest docs/tests/test_doc_snippets.py -v --tb=short
build-docs:
name: build-docs
runs-on: ubuntu-latest
container:
image: ghcr.io/hyperactive-project/hyperactive-ci:py3.12
needs: test-snippets
steps:
- uses: actions/checkout@v4
- name: Install package and docs requirements
run: |
pip install --no-cache-dir -e ".[all_extras]"
pip install --no-cache-dir -r docs/requirements.txt
- name: Show dependencies
run: python -m pip list
- name: Build documentation
run: |
cd docs && sphinx-build -b html source build/html -W --keep-going
- name: Run doctest
run: |
cd docs && sphinx-build -b doctest source build/doctest || true
- name: Upload documentation artifact
uses: actions/upload-artifact@v4
with:
name: docs-html
path: docs/build/html/
retention-days: 7