Skip to content

Commit 37db07b

Browse files
committed
CI: refactor cache keys to use the actual python version
1 parent 0117dd0 commit 37db07b

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,25 @@ inputs:
1414
runs:
1515
using: "composite"
1616
steps:
17+
- name: Setup python
18+
id: setup_python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ inputs.python-version }}
22+
1723
- name: Cache venv
1824
id: cache-venv
1925
uses: actions/cache@v4
2026
with:
2127
path: .venv
22-
key: venv-v2-${{ inputs.type }}-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('poetry.lock') }}
28+
key: venv-v4-${{ inputs.type }}-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
2329

2430
- name: Cache pre-commit
2531
id: cache-pre-commit
2632
uses: actions/cache@v4
2733
with:
2834
path: ~/.cache/pre-commit
29-
key: pre-commit-v2-${{ inputs.type }}-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
35+
key: pre-commit-v4-${{ inputs.type }}-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
3036

3137
- name: Cache setup-poetry
3238
id: cache-setup-poetry
@@ -36,13 +42,8 @@ runs:
3642
~/.local/share/pypoetry
3743
~/.local/share/virtualenv
3844
~/.local/bin/poetry
39-
key: setup-poetry-v2-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.poetry-version }}
45+
key: setup-poetry-v4-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ inputs.poetry-version }}
4046

41-
- name: Setup python
42-
id: setup_python
43-
uses: actions/setup-python@v5
44-
with:
45-
python-version: ${{ inputs.python-version }}
4647

4748
- name: Setup poetry
4849
uses: Gr1N/setup-poetry@v8

0 commit comments

Comments
 (0)