From f5179e8c19a96134ea5536443ac2143ab1b44acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elijas=20Dap=C5=A1auskas?= <4084885+Elijas@users.noreply.github.com> Date: Tue, 26 Sep 2023 01:47:18 +0300 Subject: [PATCH] ci(check): improve poetry installation cache logic --- .github/actions/setup-python-poetry/action.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup-python-poetry/action.yml b/.github/actions/setup-python-poetry/action.yml index e793bb3..5358d94 100644 --- a/.github/actions/setup-python-poetry/action.yml +++ b/.github/actions/setup-python-poetry/action.yml @@ -17,7 +17,14 @@ runs: with: python-version: ${{ inputs.python-version }} id: setup_python + - name: Cache Poetry cache + id: cached-poetry-installation + uses: actions/cache@v3 + with: + path: ~/.cache/pypoetry + key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ inputs.poetry-version }} - name: Install Poetry ${{ inputs.poetry-version }} + if: steps.cached-poetry-installation.outputs.cache-hit != 'true' run: | curl -sSL ${{ env.POETRY_URL }} | \ python - --version ${{ inputs.poetry-version }} @@ -25,13 +32,8 @@ runs: shell: bash env: POETRY_URL: https://install.python-poetry.org - - name: Cache Poetry cache - uses: actions/cache@v3 - with: - path: ~/.cache/pypoetry - key: poetry-cache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ inputs.poetry-version }} - name: Cache Packages uses: actions/cache@v3 with: path: ~/.local - key: poetry-local-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }} \ No newline at end of file + key: poetry-local-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }}