Skip to content

Commit

Permalink
ci: fix caching for poetry
Browse files Browse the repository at this point in the history
If the python version used is updated at patch level (eg 3.12.1 -> 3.12.2)
then the inputs.python-version will still be "3.12", and that leads to the
venv and poetry to be restored from cache. This can potentionally cause issues.
  • Loading branch information
csernazs committed Jul 11, 2024
1 parent 0117dd0 commit de51af9
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ inputs:
runs:
using: "composite"
steps:
- name: Cache venv
id: cache-venv
uses: actions/cache@v4
with:
path: .venv
key: venv-v2-${{ inputs.type }}-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('poetry.lock') }}

- name: Cache pre-commit
id: cache-pre-commit
uses: actions/cache@v4
Expand All @@ -33,10 +26,8 @@ runs:
uses: actions/cache@v4
with:
path: |
~/.local/share/pypoetry
~/.local/share/virtualenv
~/.local/bin/poetry
key: setup-poetry-v2-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.poetry-version }}
~/.cache/pypoetry
key: setup-poetry-v3-${{ runner.os }}-${{ inputs.python-version }}-${{ inputs.poetry-version }}

- name: Setup python
id: setup_python
Expand All @@ -47,7 +38,6 @@ runs:
- name: Setup poetry
uses: Gr1N/setup-poetry@v8
id: setup_poetry
if: steps.cache-setup-poetry.outputs.cache-hit != 'true'
with:
poetry-version: ${{ inputs.poetry-version }}

Expand Down

0 comments on commit de51af9

Please sign in to comment.