diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7426af..2c3e56e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,6 +73,7 @@ jobs: with: enable-cache: false - name: Create Python virtual environment + id: create-venv if: steps.cache-venv.outputs.cache-hit != 'true' env: AIOHTTP_NO_EXTENSIONS: 1 @@ -94,7 +95,12 @@ jobs: uv pip install pytest-xdist fi - name: Cache base Python virtual environment - if: steps.cache-venv.outputs.cache-hit != 'true' + # Use `always()` so a cancellation (e.g. fail-fast from a sibling + # matrix job, or a concurrency cancel) cannot interrupt the save + # mid-upload and leave the cache key reserved but unpopulated. + # Guard on `create-venv` success so a failed/cancelled venv build + # is never cached. + if: always() && steps.create-venv.outcome == 'success' uses: actions/cache/save@v5 with: path: .venv