Feature/ci - tox with pytest, mypy, flake8 on all py versions and 3 platforms #17
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: pull_request | |
env: | |
COLUMNS: 120 | |
jobs: | |
test_all_versions: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest] | |
python-version: ['3.8'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox tox-gh-actions | |
- name: Test with tox py${{ matrix.python-version }}-${{ matrix.os }} | |
run: tox -v | |
test_full: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: | |
- "3.12" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[tests] | |
- name: Test pytest | |
run: | | |
pytest --compile -n auto --all --junitxml=./compile-test-results.xml | |
pytest --run -n auto --all --junitxml=./run-test-results.xml | |
- name: Surface failing tests | |
if: always() | |
uses: pmeier/pytest-results-action@main | |
with: | |
# A list of JUnit XML files, directories containing the former, and wildcard | |
# patterns to process. | |
# See @actions/glob for supported patterns. | |
path: ./*-test-results.xml | |
# Add a summary of the results at the top of the report | |
# Default: true | |
summary: true | |
# Select which results should be included in the report. | |
# Follows the same syntax as | |
# `pytest -r` | |
# Default: fEX | |
display-options: fEX | |
# Fail the workflow if no JUnit XML was found. | |
# Default: true | |
fail-on-empty: true |