From 28f66b0947305804cde3a93234da31c05dd15a76 Mon Sep 17 00:00:00 2001 From: Edoardo Rosa <6991986+notdodo@users.noreply.github.com> Date: Sun, 15 Nov 2026 12:06:13 +0100 Subject: [PATCH] ci: reuse the previous venv when the lockfile changes Every lockfile change missed both caches, so Python 3.15 rebuilt its source-only dependencies from scratch (about 14 minutes). Fall back to the latest venv for the same Python version and let task install apply only the delta. Install the interpreter first, so a restored venv never points at a missing Python and gets recreated. --- .github/workflows/python-ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 9017d98..a159f81 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -35,10 +35,14 @@ jobs: .venv .mypy_cache key: python-${{ matrix.python }}-venv-${{ hashFiles('uv.lock') }} + restore-keys: | + python-${{ matrix.python }}-venv- - name: Install Task uses: go-task/setup-task@a00fbb05ce67b35648be3c78cbc9fd85354c757e # v2.2.0 with: repo-token: ${{ github.token }} + - name: Install Python + run: uv python install ${{ matrix.python }} - name: Install dependencies run: task install - name: Format, lint, and type checks