| 1 |
name: Tests |
| 2 |
on: |
| 3 |
push: |
| 4 |
branches: [main, stable] |
| 5 |
paths-ignore: ['docs/**', '*.md', '*.rst'] |
| 6 |
pull_request: |
| 7 |
paths-ignore: [ 'docs/**', '*.md', '*.rst' ] |
| 8 |
jobs: |
| 9 |
tests: |
| 10 |
name: ${{ matrix.name || matrix.python }} |
| 11 |
runs-on: ${{ matrix.os || 'ubuntu-latest' }} |
| 12 |
strategy: |
| 13 |
fail-fast: false |
| 14 |
matrix: |
| 15 |
include: |
| 16 |
- {python: '3.13'} |
| 17 |
- {python: '3.12'} |
| 18 |
- {name: Windows, python: '3.12', os: windows-latest} |
| 19 |
- {name: Mac, python: '3.12', os: macos-latest} |
| 20 |
- {python: '3.11'} |
| 21 |
- {python: '3.10'} |
| 22 |
- {python: '3.9'} |
| 23 |
- {python: '3.8'} |
| 24 |
- {python: '3.7'} |
| 25 |
- {name: PyPy, python: 'pypy-3.10', tox: pypy310} |
| 26 |
steps: |
| 27 |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 28 |
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 |
| 29 |
with: |
| 30 |
python-version: ${{ matrix.python }} |
| 31 |
allow-prereleases: true |
| 32 |
cache: pip |
| 33 |
cache-dependency-path: requirements*/*.txt |
| 34 |
- run: pip install tox |
| 35 |
- run: tox run -e ${{ matrix.tox || format('py{0}', matrix.python) }} |
| 36 |
typing: |
| 37 |
runs-on: ubuntu-latest |
| 38 |
steps: |
| 39 |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 40 |
- uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 |
| 41 |
with: |
| 42 |
python-version: '3.x' |
| 43 |
cache: pip |
| 44 |
cache-dependency-path: requirements*/*.txt |
| 45 |
- name: cache mypy |
| 46 |
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 |
| 47 |
with: |
| 48 |
path: ./.mypy_cache |
| 49 |
key: mypy|${{ hashFiles('pyproject.toml') }} |
| 50 |
- run: pip install tox |
| 51 |
- run: tox run -e typing |