1name: Tests
2on:
3  push:
4    branches:
5      - main
6      - '*.x'
7    paths-ignore:
8      - 'docs/**'
9      - '*.md'
10      - '*.rst'
11  pull_request:
12    branches:
13      - main
14      - '*.x'
15    paths-ignore:
16      - 'docs/**'
17      - '*.md'
18      - '*.rst'
19jobs:
20  tests:
21    name: ${{ matrix.name }}
22    runs-on: ${{ matrix.os }}
23    strategy:
24      fail-fast: false
25      matrix:
26        include:
27          - {name: Linux, python: '3.11', os: ubuntu-latest, tox: py311}
28          - {name: Windows, python: '3.11', os: windows-latest, tox: py311}
29          - {name: Mac, python: '3.11', os: macos-latest, tox: py311}
30          - {name: '3.12-dev', python: '3.12-dev', os: ubuntu-latest, tox: py312}
31          - {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310}
32          - {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39}
33          - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
34          - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37}
35          - {name: 'PyPy', python: 'pypy-3.10', os: ubuntu-latest, tox: pypy310}
36          - {name: Typing, python: '3.11', os: ubuntu-latest, tox: typing}
37    steps:
38      - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
39      - uses: actions/setup-python@5ccb29d8773c3f3f653e1705f474dfaa8a06a912
40        with:
41          python-version: ${{ matrix.python }}
42          cache: 'pip'
43          cache-dependency-path: 'requirements/*.txt'
44      - name: update pip
45        run: |
46          pip install -U wheel
47          pip install -U setuptools
48          python -m pip install -U pip
49      - name: cache mypy
50        uses: actions/cache@58c146cc91c5b9e778e71775dfe9bf1442ad9a12
51        with:
52          path: ./.mypy_cache
53          key: mypy|${{ matrix.python }}|${{ hashFiles('setup.cfg') }}
54        if: matrix.tox == 'typing'
55      - run: pip install tox
56      - run: tox run -e ${{ matrix.tox }}
57