Parallel Coverage in CI #204
Workflow file for this run
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 | |
tags-ignore: | |
- '**' | |
pull_request: | |
jobs: | |
test-py3: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python: | |
- version: "3.7" | |
tox-prefix: py37 | |
- version: "3.8" | |
tox-prefix: py38 | |
- version: "3.9" | |
tox-prefix: py39 | |
- version: "3.10" | |
tox-prefix: py310 | |
- version: "3.11" | |
tox-prefix: py311 | |
- version: "3.12" | |
tox-prefix: py312 | |
- version: "pypy3.10" | |
tox-prefix: pypy310 | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v3 | |
# Python version used by tox | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python.version }} | |
architecture: x64 | |
- name: Install Dependencies | |
run: | | |
pip install -U pip | |
pip install -U wheel setuptools | |
# Python version for tools | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
architecture: x64 | |
- name: Install Tools | |
run: | | |
python3.12 -m pip install -U pipx | |
pipx install tox --python=3.12 | |
pipx install coverage --python=3.12 | |
- name: Test | |
run: tox -vv -p auto -f ${{ matrix.python.tox-prefix }} -- --cov-report=xml | |
env: | |
TOX_DISCOVER: "patch-for-windows-pypy3" | |
TOX_PARALLEL_NO_SPINNER: 1 | |
- name: Combine Coverage | |
run: | | |
find . -name ".coverage.*" -exec mv {} ./ \; | |
coverage combine | |
coverage xml | |
- name: Upload Coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
files: coverage.xml | |
fail_ci_if_error: true | |
- name: Lint | |
run: tox -vv | |
env: | |
TOXENV: lint | |
if: matrix.python.version == 3.9 && matrix.os == 'ubuntu-latest' | |
- name: Docs | |
run: tox -vv | |
env: | |
TOXENV: docs | |
if: matrix.python.version == 3.9 && matrix.os == 'ubuntu-latest' |