1name: Tests 2on: 3 push: 4 branches: 5 - master 6 - '*.x' 7 pull_request: 8 branches: 9 - master 10 - '*.x' 11jobs: 12 tests: 13 name: ${{ matrix.name }} 14 runs-on: ${{ matrix.os }} 15 strategy: 16 fail-fast: false 17 matrix: 18 include: 19 - {name: Linux, python: '3.8', os: ubuntu-latest, tox: py38} 20 - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37} 21 - {name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36} 22 - {name: 'PyPy', python: pypy3, os: ubuntu-latest, tox: pypy3} 23 - {name: Style, python: '3.8', os: ubuntu-latest, tox: style} 24 - {name: Docs, python: '3.8', os: ubuntu-latest, tox: docs} 25 - {name: Windows, python: '3.8', os: windows-latest, tox: py38} 26 - {name: Mac, python: '3.8', os: macos-latest, tox: py38} 27 steps: 28 - uses: actions/checkout@v2 29 - uses: actions/setup-python@v2 30 with: 31 python-version: ${{ matrix.python }} 32 - name: update pip 33 run: | 34 pip install -U wheel 35 pip install -U setuptools 36 python -m pip install -U pip 37 - name: get pip cache dir 38 id: pip-cache 39 run: echo "::set-output name=dir::$(pip cache dir)" 40 - name: cache pip 41 uses: actions/cache@v1 42 with: 43 path: ${{ steps.pip-cache.outputs.dir }} 44 key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements/*.txt') }} 45 - name: cache pre-commit 46 uses: actions/cache@v1 47 with: 48 path: ~/.cache/pre-commit 49 key: pre-commit|${{ matrix.python }}|${{ hashFiles('.pre-commit-config.yaml') }} 50 if: matrix.tox == 'style' 51 - run: pip install tox 52 - run: tox -e ${{ matrix.tox }} 53