Skip to content

Do not treat warnings as errors in sphinx CI job #492

Do not treat warnings as errors in sphinx CI job

Do not treat warnings as errors in sphinx CI job #492

Workflow file for this run

# SPDX-FileCopyrightText: 2019–2025 Pynguin Contributors
#
# SPDX-License-Identifier: MIT
name: CI
on: [push, pull_request]
# -----------------------------
# LINT JOBS: pre-commit & mypy
# -----------------------------
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Setup Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: "2.1.4"
# Required for act.
# On mac-os: act -j tests --container-architecture linux/amd64 -P macos-latest=catthehacker/ubuntu:act-latest
- name: Ensure poetry is in PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install --extras "openai numpy fandango-faker"
- name: Run pre-commit hooks
run: poetry run pre-commit run --all-files
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Setup Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: "2.1.4"
- name: Ensure poetry is in PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install --extras "openai numpy fandango-faker"
- name: Run mypy
run: poetry run mypy
# -----------------------------
# TESTS JOB
# -----------------------------
tests:
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
poetry-version: [ "2.1.4" ]
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
needs: [ pre-commit, mypy ]
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup Poetry
uses: abatilo/actions-poetry@v4
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Ensure poetry is in PATH
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install --extras "openai numpy fandango-faker"
- name: Run tests with coverage
run: poetry run pytest --cov=src --cov=tests --cov-branch --cov-report=term-missing --cov-report=xml tests/
- name: Generate XML report
run: poetry run coverage xml -o coverage.xml
# The upload for hidden files does not work
- name: Rename coverage file
run: mv .coverage raw-coverage
- name: Upload coverage data
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.os }}-${{ matrix.python-version }}
path: |
raw-coverage
coverage.xml
# -----------------------------
# COMBINE COVERAGE JOB
# -----------------------------
combine-coverage:
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Download coverage artifacts
uses: actions/download-artifact@v4
with:
path: coverages
- name: Combine coverage reports
run: |
pip install coverage[toml]
coverage combine coverages/coverage-*/raw-coverage
coverage report
coverage xml -o coverage.xml
coverage html -d cov_html
- name: Upload merged coverage report
uses: actions/upload-artifact@v4
with:
name: merged-coverage
path: |
coverage.xml
cov_html
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}