Skip to content

Commit

Permalink
Cache poetry install (#1723)
Browse files Browse the repository at this point in the history
* Update poetry installer with cache
* Bump up poetry version
  • Loading branch information
jonathangreen authored Mar 12, 2024
1 parent 69bfe58 commit c951384
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/actions/poetry/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
version:
description: "Version of poetry to install"
required: false
default: "1.5.1"
default: "1.7.1"

outputs:
version:
Expand All @@ -15,9 +15,21 @@ outputs:
runs:
using: "composite"
steps:
- run: |
curl -sSL https://install.python-poetry.org | python - --yes --version ${{ inputs.version }}
echo "$HOME/.local/bin" >> $GITHUB_PATH
- uses: actions/cache@v4
id: cache
with:
path: ${{ runner.temp }}/poetry
key: ${{ runner.os }}-poetry-install-${{ inputs.version }}

- run: curl -sSL https://install.python-poetry.org | python - --yes --version ${{ inputs.version }}
env:
POETRY_HOME: ${{ runner.temp }}/poetry
if: steps.cache.outputs.cache-hit != 'true'
shell: bash

- run: echo "$POETRY_HOME/bin" >> $GITHUB_PATH
env:
POETRY_HOME: ${{ runner.temp }}/poetry
shell: bash

- id: poetry-version
Expand Down

0 comments on commit c951384

Please sign in to comment.