|
1 | | -name: CI |
| 1 | +name: Tests |
2 | 2 |
|
3 | | -on: [push, pull_request, workflow_dispatch] |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + paths-ignore: |
| 8 | + - 'docs/**' |
| 9 | + - '*.md' |
| 10 | + - '*.rst' |
| 11 | + pull_request: |
| 12 | + branches: |
| 13 | + - master |
| 14 | + paths-ignore: |
| 15 | + - 'docs/**' |
| 16 | + - '*.md' |
| 17 | + - '*.rst' |
4 | 18 |
|
5 | 19 | jobs: |
6 | 20 | tests: |
7 | | - name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" |
| 21 | + name: "Python ${{ matrix.name }} on ${{ matrix.os }}" |
8 | 22 | runs-on: "${{ matrix.os }}" |
9 | 23 |
|
10 | 24 | strategy: |
| 25 | + fail-fast: false |
11 | 26 | matrix: |
12 | | - python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3"] |
13 | | - os: ["ubuntu-latest", "macos-latest"] |
| 27 | + include: |
| 28 | + - {name: Linux, python: '3.9', os: ubuntu-latest, tox: py39} |
| 29 | + - {name: Windows, python: '3.9', os: windows-latest, tox: py39} |
| 30 | + - {name: Mac, python: '3.9', os: macos-latest, tox: py39} |
| 31 | + - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38} |
| 32 | + - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37} |
| 33 | + - {name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36} |
| 34 | + - {name: 'PyPy', python: pypy3, os: ubuntu-latest, tox: pypy3} |
14 | 35 |
|
15 | 36 | steps: |
16 | 37 | - uses: "actions/checkout@v2" |
17 | 38 | - uses: "actions/setup-python@v2" |
18 | 39 | with: |
19 | | - python-version: "${{ matrix.python-version }}" |
20 | | - - name: "Install dependencies" |
| 40 | + python-version: ${{ matrix.python }} |
| 41 | + - name: update pip |
21 | 42 | run: | |
22 | 43 | set -xe |
23 | 44 | python -VV |
24 | 45 | python -m site |
25 | | - python -m pip install --upgrade pip setuptools wheel |
26 | | - python -m pip install --upgrade virtualenv tox tox-gh-actions |
27 | | -
|
28 | | - - name: "Run tox targets for ${{ matrix.python-version }}" |
29 | | - run: "python -m tox" |
| 46 | + pip install -U wheel |
| 47 | + pip install -U setuptools |
| 48 | + python -m pip install -U pip |
| 49 | + - name: get pip cache dir |
| 50 | + id: pip-cache |
| 51 | + run: echo "::set-output name=dir::$(pip cache dir)" |
| 52 | + - name: cache pip |
| 53 | + uses: actions/cache@v2 |
| 54 | + with: |
| 55 | + path: ${{ steps.pip-cache.outputs.dir }} |
| 56 | + key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements/*.txt') }} |
| 57 | + - run: pip install tox |
| 58 | + - name: "Run tox targets for ${{ matrix.python }}" |
| 59 | + run: tox -e ${{ matrix.tox }} |
0 commit comments