From 619516260db3e621756a528708afcb37d4e6816a Mon Sep 17 00:00:00 2001 From: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com> Date: Tue, 5 Sep 2023 14:03:03 -0400 Subject: [PATCH] Re-enable poetry binary caching with fix and more logging. (#10244) - Revert "Temporarily disable step that seems to be transiently failing. (#10234)" - Refresh shell hashtable and show poetry/python location and version. --- .github/actions/poetry_setup/action.yml | 34 ++++++++++++++++--------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/actions/poetry_setup/action.yml b/.github/actions/poetry_setup/action.yml index 9d7ce548de..357851d7ae 100644 --- a/.github/actions/poetry_setup/action.yml +++ b/.github/actions/poetry_setup/action.yml @@ -31,26 +31,36 @@ runs: with: python-version: ${{ inputs.python-version }} - # - uses: actions/cache@v3 - # id: cache-bin-poetry - # name: Cache Poetry binary - Python ${{ inputs.python-version }} - # env: - # SEGMENT_DOWNLOAD_TIMEOUT_MIN: "1" - # with: - # path: | - # /opt/pipx/venvs/poetry - # /opt/pipx_bin/poetry - # # This step caches the poetry installation, so make sure it's keyed on the poetry version as well. - # key: bin-poetry-${{ runner.os }}-${{ runner.arch }}-py-${{ inputs.python-version }}-${{ inputs.poetry-version }} + - uses: actions/cache@v3 + id: cache-bin-poetry + name: Cache Poetry binary - Python ${{ inputs.python-version }} + env: + SEGMENT_DOWNLOAD_TIMEOUT_MIN: "1" + with: + path: | + /opt/pipx/venvs/poetry + /opt/pipx_bin/poetry + # This step caches the poetry installation, so make sure it's keyed on the poetry version as well. + key: bin-poetry-${{ runner.os }}-${{ runner.arch }}-py-${{ inputs.python-version }}-${{ inputs.poetry-version }} - name: Install poetry - # if: steps.cache-bin-poetry.outputs.cache-hit != 'true' + if: steps.cache-bin-poetry.outputs.cache-hit != 'true' shell: bash env: POETRY_VERSION: ${{ inputs.poetry-version }} PYTHON_VERSION: ${{ inputs.python-version }} run: pipx install "poetry==$POETRY_VERSION" --python "python$PYTHON_VERSION" --verbose + - name: Refresh shell hashtable and show python/poetry binaries and versions + shell: bash + run: | + set -eux + hash -r + ls -alh /opt/pipx_bin/poetry + ls -alh /opt/pipx/venvs/poetry/bin/python + /opt/pipx/venvs/poetry/bin/python --version + /opt/pipx_bin/poetry --version + - name: Restore pip and poetry cached dependencies uses: actions/cache@v3 env: