Docs: Update API documentation display #1350
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
name: Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
jobs: | |
tests: | |
if: ${{ !github.event.pull_request.draft }} | |
name: Tests | |
strategy: | |
matrix: | |
python-version: | |
- "3.8" | |
- "3.9" | |
- "3.10" | |
- "3.11" | |
- "3.12" | |
os: | |
- ubuntu-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PDM | |
uses: pdm-project/setup-pdm@main | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup Nox | |
uses: wntrblm/nox@2022.11.21 | |
- name: Install dependencies | |
run: pdm sync | |
- name: Run Tests | |
run: nox --no-venv -s test | |
- name: Upload coverage data | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage-data | |
path: .coverage.* | |
if-no-files-found: ignore | |
coverage: | |
if: ${{ !github.event.pull_request.draft }} | |
name: Coverage | |
runs-on: ubuntu-latest | |
needs: tests | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- run: python -m pip install --upgrade coverage[toml] | |
- name: Download coverage data | |
uses: actions/download-artifact@v2 | |
with: | |
name: coverage-data | |
- name: Combine coverage & fail if it's <100% | |
run: | | |
python -m coverage combine | |
python -m coverage html --skip-covered --skip-empty | |
python -m coverage report --fail-under=95 | |
- name: Upload HTML report if check failed | |
uses: actions/upload-artifact@v2 | |
with: | |
name: html-report | |
path: htmlcov | |
if: ${{ failure() }} |