Skip to content

Commit

Permalink
fix poetry caching by including bugfix semver in cache key.
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianPugh committed Oct 10, 2024
1 parent 3bb274d commit 35f069c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build_wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
fetch-depth: 0

- name: Set up python ${{ env.PYTHON }}
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON }}
Expand All @@ -31,7 +32,7 @@ jobs:
id: cached-poetry
with:
path: ${{ env.POETRY_HOME }}
key: poetry-cache-${{ runner.os }}-${{ env.PYTHON }}-${{ hashFiles('.github/workflows/build_wheels.yaml') }}
key: poetry-cache-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.github/workflows/build_wheels.yaml') }}

- name: Install poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -90,6 +91,7 @@ jobs:

- name: Set up python ${{ env.PYTHON }}
uses: actions/setup-python@v5
id: setup-python
with:
python-version: ${{ env.PYTHON }}

Expand Down Expand Up @@ -138,6 +140,7 @@ jobs:

- name: Set up python ${{ env.PYTHON }}
uses: actions/setup-python@v5
id: setup-python
with:
python-version: ${{ env.PYTHON }}

Expand Down Expand Up @@ -179,6 +182,7 @@ jobs:

- name: Set up python ${{ env.PYTHON }}
uses: actions/setup-python@v5
id: setup-python
with:
python-version: ${{ env.PYTHON }}

Expand Down Expand Up @@ -211,6 +215,7 @@ jobs:
fetch-depth: 0

- uses: actions/setup-python@v5
id: setup-python
with:
python-version: "3.12"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
id: cached-poetry
with:
path: ${{ env.POETRY_HOME }}
key: poetry-cache-${{ runner.os }}-${{ env.PYTHON }}-${{ hashFiles('.github/workflows/deploy.yaml') }}
key: poetry-cache-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.github/workflows/deploy.yaml') }}

- name: Install poetry
uses: snok/install-poetry@v1
Expand All @@ -51,7 +51,7 @@ jobs:
id: cached-venv
with:
path: .venv/
key: venv-cache-${{ runner.os }}-${{ env.PYTHON }}-${{ hashFiles('.github/workflows/deploy.yaml') }}
key: venv-cache-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.github/workflows/deploy.yaml') }}

- name: Install project
run: poetry install --no-interaction
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
id: cached-poetry
with:
path: ${{ env.POETRY_HOME }}
key: poetry-cache-${{ runner.os }}-${{ env.PYTHON }}-${{ hashFiles('.github/workflows/tests.yaml') }}
key: poetry-cache-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.github/workflows/tests.yaml') }}

- name: Install poetry
uses: snok/install-poetry@v1
Expand All @@ -77,7 +77,7 @@ jobs:
id: cached-venv
with:
path: .venv/
key: venv-cache-${{ runner.os }}-${{ env.PYTHON }}-${{ hashFiles('.github/workflows/tests.yaml') }}
key: venv-cache-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.github/workflows/tests.yaml') }}

- name: Install library
run: poetry install --no-interaction
Expand Down

0 comments on commit 35f069c

Please sign in to comment.