Skip to content

Commit f8cb544

Browse files
committed
ci: Take into account the python version for caching
Different Python versions could potentially have different dependencies (for example if a newer library version only works with a newer python) so it is safer to have one cache per python version. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 9be0b29 commit f8cb544

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ jobs:
2727
- uses: actions/cache@v3
2828
with:
2929
path: ~/.cache/pip
30-
key: ${{ runner.os }}-pip-${{ hashFiles('minimum-requirements-ci.txt', 'pyproject.toml') }}
30+
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('minimum-requirements-ci.txt', 'pyproject.toml') }}
3131
restore-keys: |
32-
${{ runner.os }}-pip-
32+
${{ runner.os }}-${{ matrix.python-version }}-pip-
3333
3434
- name: Install required Python packages
3535
run: |
@@ -56,9 +56,9 @@ jobs:
5656
- uses: actions/cache@v3
5757
with:
5858
path: ~/.cache/pip
59-
key: ${{ runner.os }}-pip-${{ hashFiles('minimum-requirements-ci.txt', 'pyproject.toml') }}
59+
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('minimum-requirements-ci.txt', 'pyproject.toml') }}
6060
restore-keys: |
61-
${{ runner.os }}-pip-
61+
${{ runner.os }}-${{ matrix.python-version }}-pip-
6262
6363
- name: Install required Python packages
6464
run: |

0 commit comments

Comments
 (0)