Skip to content

Commit 1eee9ac

Browse files
committed
Add pip and tox caching to CI workflows
- Add pip caching to Python setup steps in test and lint workflows - Add cache-dependency-path pointing to setup.py for pip caching - Add tox environment caching to reduce setup time - Cache key includes tox.ini and setup.py hashes
1 parent 0d1d2bb commit 1eee9ac

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ jobs:
8686
if: ${{ steps.counter.outputs.count > 0 }}
8787
with:
8888
python-version: '3.9'
89+
cache: 'pip'
90+
cache-dependency-path: 'setup.py'
8991
- run: pip install mypy==1.5.1
9092
if: ${{ steps.counter.outputs.count > 0 }}
9193
- run: mypy ${{ steps.filter.outputs.python_files }} --follow-imports=silent --ignore-missing-imports

.github/workflows/test.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ jobs:
3535
uses: actions/setup-python@v4
3636
with:
3737
python-version: ${{ matrix.py }}
38+
cache: 'pip'
39+
cache-dependency-path: 'setup.py'
40+
- name: Cache tox environments
41+
uses: actions/cache@v3
42+
with:
43+
path: .tox
44+
key: tox-${{ matrix.os }}-${{ matrix.py }}-${{ hashFiles('tox.ini', 'setup.py') }}
45+
restore-keys: |
46+
tox-${{ matrix.os }}-${{ matrix.py }}-
3847
- name: Setup test suite
3948
run: |
4049
sudo apt-get update && sudo apt-get install -y portaudio19-dev

0 commit comments

Comments
 (0)