Skip to content

feat: robust testing for docs #952

feat: robust testing for docs

feat: robust testing for docs #952

Workflow file for this run

name: Test Python Code
on:
pull_request:
paths:
- '**/*.py'
jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: SonarCloud Scan
uses: sonarsource/sonarqube-scan-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
code-formatting-syntax-and-docstrings:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check code formatting using ruff
uses: astral-sh/ruff-action@v3
with:
version: 0.11.2
args: format --check
- name: Check import order
uses: astral-sh/ruff-action@v3
with:
version: 0.11.2
args: check --select I
- name: Lint
uses: astral-sh/ruff-action@v3
with:
version: 0.11.2
args: check
- name: Check docstrings using interrogate
run: |
pip install interrogate
if [ $(interrogate -c pyproject.toml -v . -f 100 | grep "FAILED" | wc -l) = 1 ]; then
echo "necessary docstrings missing:"
interrogate -vv -c pyproject.toml --omit-covered-files . -f 100
exit 1
fi
functionality-tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
needs: [code-formatting-syntax-and-docstrings]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
id: cached_python_setup
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: pyproject.toml
- name: "run tests without ~/.deeporigin/"
run: |
pip install --upgrade pip
pip install --upgrade setuptools
pip install -e .[test,tools]
make test-github
- name: "test docs with pytest markdown-docs"
run: |
pytest -x --markdown-docs --markdown-docs-syntax=superfences