diff --git a/.github/actions/poetry/action.yml b/.github/actions/poetry/action.yml index 3e6a2db296..77be7c948f 100644 --- a/.github/actions/poetry/action.yml +++ b/.github/actions/poetry/action.yml @@ -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: $HOME/.poetry + key: ${{ runner.os }}-poetry-install-${{ inputs.version }} + + - run: curl -sSL https://install.python-poetry.org | python - --yes --version ${{ inputs.version }} + env: + POETRY_HOME: $HOME/.poetry + if: steps.cache.outputs.cache-hit != 'true' + shell: bash + + - run: echo "$POETRY_HOME/bin" >> $GITHUB_PATH + env: + POETRY_HOME: $HOME/.poetry shell: bash - id: poetry-version