1212 test :
1313 name : ${{ matrix.os }} (${{ matrix.python-version }})
1414 runs-on : ${{ matrix.os }}
15-
1615 strategy :
1716 fail-fast : false
1817 matrix :
@@ -22,102 +21,61 @@ jobs:
2221 # pypy3 randomly fails on Windows builds
2322 - os : windows-latest
2423 python-version : " pypy-3.7"
25-
24+ include :
25+ - os : ubuntu-latest
26+ path : ~/.cache/pip
27+ - os : macos-latest
28+ path : ~/Library/Caches/pip
29+ - os : windows-latest
30+ path : ~\AppData\Local\pip\Cache
2631 steps :
27- # Check out latest code
2832 - uses : actions/checkout@v2
29-
30- # Configure pip cache
31- - name : Cache pip (Linux)
32- uses : actions/cache@v2
33- if : startsWith(runner.os, 'Linux')
34- with :
35- path : ~/.cache/pip
36- key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
37- restore-keys : |
38- ${{ runner.os }}-pip-
39-
40- - name : Cache pip (macOS)
41- uses : actions/cache@v2
42- if : startsWith(runner.os, 'macOS')
43- with :
44- path : ~/Library/Caches/pip
45- key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
46- restore-keys : |
47- ${{ runner.os }}-pip-
48-
49- - name : Cache pip (Windows)
33+ - name : Cache pip
5034 uses : actions/cache@v2
51- if : startsWith(runner.os, 'Windows')
5235 with :
53- path : ~\AppData\Local\pip\Cache
54- key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
55- restore-keys : |
56- ${{ runner.os }}-pip-
57-
58- # Set up Python
36+ path : ${{ matrix.path }}
37+ key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
38+ restore-keys : ${{ runner.os }}-pip-
5939 - name : Set up Python ${{ matrix.python-version }}
6040 uses : actions/setup-python@v2
6141 with :
6242 python-version : ${{ matrix.python-version }}
63-
64- # Install dependencies
6543 - name : Install dependencies
6644 run : |
6745 pip install -U pip setuptools wheel
6846 pip install -U tox tox-gh-actions
69-
70- # Run tests
7147 - name : Test with tox
7248 run : tox
73-
74- # Upload coverage report
7549 - name : Upload coverage to Codecov
7650 uses : codecov/codecov-action@v2
7751 with :
7852 file : coverage.xml
7953
8054 lint :
8155 runs-on : ubuntu-latest
82-
8356 steps :
84- # Check out latest code
8557 - uses : actions/checkout@v2
86-
87- # Set up Python
8858 - name : Set up Python 3.10
8959 uses : actions/setup-python@v2
9060 with :
9161 python-version : " 3.10"
92-
93- # Configure pip cache
9462 - name : Cache pip
9563 uses : actions/cache@v2
9664 with :
9765 path : ~/.cache/pip
98- key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
99- restore-keys : |
100- ${{ runner.os }}-pip-
101-
102- # Configure pre-commit cache
66+ key : ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
67+ restore-keys : ${{ runner.os }}-pip-
10368 - name : Cache pre-commit
10469 uses : actions/cache@v2
10570 with :
10671 path : ~/.cache/pre-commit
10772 key : ${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }}
108- restore-keys : |
109- ${{ runner.os }}-pre-commit-
110-
111- # Install dependencies
73+ restore-keys : ${{ runner.os }}-pre-commit-
11274 - name : Install dependencies
11375 run : |
11476 pip install -U pip setuptools wheel
11577 pip install -U tox
116-
117- # Lint code
11878 - name : Lint code
119- run : tox -e lint
120-
121- # Lint docs
79+ run : tox -e lint -- --show-diff-on-failure
12280 - name : Lint docs
12381 run : tox -e docs
0 commit comments