ci: cache pip only when no container is used

This commit is contained in:
Erik Sundell
2024-09-20 21:29:46 +02:00
parent 7be7eb4968
commit 94a16d6ddd
2 changed files with 3 additions and 15 deletions

View File

@@ -126,6 +126,9 @@ jobs:
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5
with: with:
python-version: "3.10" python-version: "3.10"
cache: pip
cache-dependency-path: |
integration-tests/requirements.txt
# FIXME: The test_bootstrap.py script has duplicated logic to run build # FIXME: The test_bootstrap.py script has duplicated logic to run build
# and start images and run things in them. This makes tests slower, # and start images and run things in them. This makes tests slower,

View File

@@ -69,21 +69,6 @@ jobs:
python3 -m venv /srv/venv python3 -m venv /srv/venv
echo '/srv/venv/bin' >> $GITHUB_PATH echo '/srv/venv/bin' >> $GITHUB_PATH
# WARNING: This action loads a cache of pip dependencies based on the
# declared key, and it will save a cache for that key on job
# completion. Make sure to update the key to bust the cache
# properly if you make a change that should influence it.
- name: Load cached Python dependencies
uses: actions/cache@v4
with:
path: /srv/venv/
key: >-
pip-
${{ matrix.runs_on }}-
${{ matrix.ubuntu_version }}-
${{ matrix.python_version }}-
${{ hashFiles('setup.py', 'dev-requirements.txt', '.github/workflows/unit-test.yaml') }}
- name: Install Python dependencies - name: Install Python dependencies
run: | run: |
pip install -r dev-requirements.txt pip install -r dev-requirements.txt