From 1eee9ac32f8ebb723c8a8609a12c7a8a4bf83ac4 Mon Sep 17 00:00:00 2001 From: James He Date: Wed, 17 Dec 2025 15:27:58 -0700 Subject: [PATCH] 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 --- .github/workflows/lint.yml | 2 ++ .github/workflows/test.yml | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3b7a910..6b55000 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -86,6 +86,8 @@ jobs: if: ${{ steps.counter.outputs.count > 0 }} with: python-version: '3.9' + cache: 'pip' + cache-dependency-path: 'setup.py' - run: pip install mypy==1.5.1 if: ${{ steps.counter.outputs.count > 0 }} - run: mypy ${{ steps.filter.outputs.python_files }} --follow-imports=silent --ignore-missing-imports diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 48f696f..57a1fef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,6 +35,15 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.py }} + cache: 'pip' + cache-dependency-path: 'setup.py' + - name: Cache tox environments + uses: actions/cache@v3 + with: + path: .tox + key: tox-${{ matrix.os }}-${{ matrix.py }}-${{ hashFiles('tox.ini', 'setup.py') }} + restore-keys: | + tox-${{ matrix.os }}-${{ matrix.py }}- - name: Setup test suite run: | sudo apt-get update && sudo apt-get install -y portaudio19-dev