Skip to content

[pre-commit.ci] pre-commit autoupdate #1070

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #1070

Workflow file for this run

name: Tests
on:
- push
- pull_request
jobs:
tests:
name: ${{ matrix.session }} ${{ matrix.python }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { python: "3.12", os: "ubuntu-latest", session: "mypy" }
- { python: "3.11", os: "ubuntu-latest", session: "mypy" }
- { python: "3.10", os: "ubuntu-latest", session: "mypy" }
- { python: "3.9", os: "ubuntu-latest", session: "mypy" }
- { python: "3.11", os: "ubuntu-latest", session: "tests" }
- { python: "3.10", os: "ubuntu-latest", session: "tests" }
- { python: "3.9", os: "ubuntu-latest", session: "tests" }
- { python: "3.11", os: "macos-latest", session: "tests" }
- { python: "3.11", os: "ubuntu-latest", session: "xdoctest" }
- { python: "3.12", os: "ubuntu-latest", session: "tests-nojit" }
env:
NOXSESSION: ${{ matrix.session }}
FORCE_COLOR: "1"
PRE_COMMIT_COLOR: "always"
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Upgrade pip
run: |
pip install --upgrade pip
pip --version
- name: Install Nox
run: |
pipx install nox --python $(which python)
nox --version
- name: Run Nox
run: |
nox --python=${{ matrix.python }}
- name: Upload coverage data
if: always() && startsWith(matrix.session, 'tests')
uses: "actions/upload-artifact@v4"
with:
name: coverage-data-${{ matrix.python }}-${{ matrix.os }}-${{ matrix.session }}
path: ".coverage.*"
coverage:
runs-on: ubuntu-latest
needs: tests
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Upgrade pip
run: |
pip install --upgrade pip
pip --version
- name: Install Nox
run: |
pipx install nox
nox --version
- name: Download coverage data
uses: actions/download-artifact@v4
with:
pattern: coverage-data-*
merge-multiple: true
- name: Combine coverage data and display human readable report
run: |
nox --session=coverage
- name: Create coverage report
run: |
nox --session=coverage -- xml
- name: Upload coverage report
uses: codecov/codecov-action@v4.1.0