ci: cache pip before install and fix cache key OS expansion
Build and publish container / build (pull_request) Successful in 8m56s

Move the actions/cache step ahead of the dependency install so a
warm cache actually accelerates the install, and replace the
unexpanded $RUNNER_OS shell variable with the ${{ runner.os }}
Actions expression in the cache key and restore-keys.

Fixes #8

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-17 17:15:58 +01:00
parent e05f08995e
commit a1def7881c
+5 -5
View File
@@ -45,16 +45,16 @@ jobs:
with: with:
python-version: 3.12 python-version: 3.12
- name: Install test dependencies
run: python -m pip install --upgrade pip && pip install -r requirements-dev.txt
- name: Cache pip dependencies - name: Cache pip dependencies
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: ~/.cache/pip path: ~/.cache/pip
key: "$RUNNER_OS-pip-${{ hashFiles('requirements-dev.txt') }}" key: "${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }}"
restore-keys: | restore-keys: |
$RUNNER_OS-pip- ${{ runner.os }}-pip-
- name: Install test dependencies
run: python -m pip install --upgrade pip && pip install -r requirements-dev.txt
- name: Run unit tests - name: Run unit tests
run: python -m pytest -q run: python -m pytest -q