Skip to content

docs: Update the documentation #249

docs: Update the documentation

docs: Update the documentation #249

name: PR checks
on:
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.10' ]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'
- name: Install the requirements
run: pip install -r requirements.txt
- name: Execute the unittests
run: python3 -m unittest discover tests
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.10' ]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'
- name: Install the requirements
run: pip install -r requirements.txt
- name: Execute the linting checks
uses: reviewdog/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
flake8_args: --config=.flake8
coverage:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.10' ]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'
- name: Install the requirements
run: pip install -r requirements.txt && pip install pytest pytest-cov coverage-badge
- name: Generate the coverage report
run: export PYTHONPATH=$PWD && pytest --junitxml=pytest.xml --cov=. tests/ | tee pytest-coverage.txt
- name: Execute the coverage checks
uses: MishaKav/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
hide-badge: true
create-new-comment: true
- name: Generate coverage badge
run: coverage-badge -f -o docs/coverage.svg
- name: Check changed files
uses: tj-actions/verify-changed-files@v20
id: verify-changed-files
with:
files: |
docs
- name: Commit files
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add --force docs
git commit -m "Add coverage badge"
- name: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}
force: true
documentation:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9' ]
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
cache: 'pip'
- name: Install the requirements
run: pip install pydoc-markdown==4.6.3 mkdocs mkdocs-material
- name: Generate documentation
run: pydoc-markdown --render-toc && rm -rf docs/content && mv build/docs/* docs
- name: Check changed files
uses: tj-actions/verify-changed-files@v20
id: verify-changed-files
with:
files: |
docs
- name: Commit files
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add --force docs
git commit -m "docs: Add the documentation"
- name: Push changes
uses: ad-m/github-push-action@master
if: steps.verify-changed-files.outputs.files_changed == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.head_ref }}