[pre-commit.ci] pre-commit autoupdate #71
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: test | |
on: | |
push: | |
jobs: | |
pytest: | |
runs-on: ${{ matrix.os }}-latest | |
timeout-minutes: 10 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu | |
- macos | |
- windows | |
py: | |
- '3.10' | |
- '3.9' | |
- '3.8' | |
- '3.7' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup python for test ${{ matrix.py }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.py }} | |
- name: Pick environment to run | |
run: | | |
import platform | |
import os | |
import sys | |
if platform.python_implementation() == "PyPy": | |
base = f"pypy{sys.version_info.major}" | |
else: | |
base = f"py{sys.version_info.major}{sys.version_info.minor}" | |
env = f"BASE={base}\n" | |
print(f"Picked:\n{env}for {sys.version}") | |
with open(os.environ["GITHUB_ENV"], "a", encoding="utf-8") as file: | |
file.write(env) | |
shell: python | |
- name: Setup python for tox | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install tox | |
run: python -m pip install tox | |
- name: Setup test suite | |
run: tox -vv --notest -e ${{env.BASE}},${{env.BASE}}-path,${{env.BASE}}-sdist,${{env.BASE}}-wheel | |
- name: Run test suite via tox | |
run: tox -e ${{env.BASE}} --skip-pkg-install | |
- name: Run test suite via path | |
run: tox -e ${{env.BASE}}-path --skip-pkg-install | |
- name: Run test suite via sdist | |
run: tox -e ${{env.BASE}}-sdist --skip-pkg-install | |
- name: Run test suite via wheel | |
run: tox -e ${{env.BASE}}-wheel --skip-pkg-install | |
- name: Rename coverage report file | |
run: mv ".tox/coverage.${BASE}.xml" .tox/coverage.xml | |
shell: bash | |
- uses: codecov/codecov-action@v2 | |
if: ${{ always() }} | |
env: | |
PYTHON: ${{ matrix.python }} | |
with: | |
file: ./.tox/coverage.xml | |
flags: tests | |
env_vars: PYTHON | |
name: ${{ matrix.py }} - ${{ matrix.os }} | |
type: | |
runs-on: ubuntu-latest | |
env: | |
PY_COLORS: 1 | |
TOX_PARALLEL_NO_SPINNER: 1 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Install tox | |
run: python -m pip install tox |