[pre-commit.ci] pre-commit autoupdate #623
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: Testsuite | |
on: | |
[push, pull_request] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"] | |
include: | |
- python-version: "pypy-3.7" | |
os: ubuntu-latest | |
- python-version: "pypy-3.9" | |
os: ubuntu-latest | |
- python-version: "pypy-3.10" | |
os: ubuntu-latest | |
env: | |
OS: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get pip cache dir | |
id: pip-cache | |
run: | | |
python -m pip install -U pip # to ensure version > 20 to have cache dir | |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT | |
- name: pip cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.pip-cache.outputs.dir }} | |
key: py${{ matrix.python-version }}-${{ matrix.os }}-pip | |
- name: Test environment setup | |
run: | | |
python -m pip install wheel | |
python -m pip install pytest pytest-cov tox | |
- name: Run tests | |
run: | | |
TOX_PYTHON_VERSION=$(if [[ ${{ matrix.python-version }} == pypy* ]]; then echo ${{ matrix.python-version }} | tr -d .-; else echo py${{ matrix.python-version }} | tr -d .-; fi) | |
COV_CMD=$(if [ ${{ matrix.python-version }} == 3.10 ]; then echo "--cov=./pytest_order/ --cov-report=xml"; else echo ; fi) tox -e $(tox -l | grep "$TOX_PYTHON_VERSION" | paste -sd "," -) | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
if: ${{ success() && matrix.python-version == 3.10 }} | |
with: | |
env_vars: OS | |
name: codecov-pytest-order |