Skip to content

tests

tests #234

Workflow file for this run

name: tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
types: [ "opened", "reopened", "synchronize" ]
schedule:
- cron: '0 12 * * 0' # run once a week on Sunday
# Allow to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
tests:
strategy:
matrix:
config:
# [Python version, tox env]
- ["3.10", "py310"]
- ["3.11", "py311"]
- ["3.12", "py312"]
- ["3.13", "py313"]
- ["3.14", "py314"]
- ["pypy-3.11", "pypy3"]
- ["3.13", "coverage"]
runs-on: ubuntu-latest
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.config[0] }}
- name: Pip cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('setup.*', 'tox.ini') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test
run: tox -e ${{ matrix.config[1] }}
- name: Coverage
if: matrix.config[1] == 'coverage'
run: |
pip install coveralls coverage-python-version
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
platform:
# Test devel setup on different platforms.
name: Platform-${{ matrix.os }}
needs: [ tests ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
architecture: 'x64'
- name: Development setup on platform ${{ matrix.os }}
run: |
python -m pip install -U pip
python -m pip install pytest
python -m pip install -e .
- name: Tests
run: pytest