Skip to content

Commit 8c80449

Browse files
committed
ci - Change GitHub actions to reduce number of build tasks
1 parent 367dcf1 commit 8c80449

File tree

1 file changed

+42
-12
lines changed

1 file changed

+42
-12
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,59 @@
1-
name: CI
1+
name: Tests
22

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'
418

519
jobs:
620
tests:
7-
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}"
21+
name: "Python ${{ matrix.name }} on ${{ matrix.os }}"
822
runs-on: "${{ matrix.os }}"
923

1024
strategy:
25+
fail-fast: false
1126
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}
1435

1536
steps:
1637
- uses: "actions/checkout@v2"
1738
- uses: "actions/setup-python@v2"
1839
with:
19-
python-version: "${{ matrix.python-version }}"
20-
- name: "Install dependencies"
40+
python-version: ${{ matrix.python }}
41+
- name: update pip
2142
run: |
2243
set -xe
2344
python -VV
2445
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

Comments
 (0)