Skip to content

Commit

Permalink
ci(check): improve poetry installation cache logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Elijas authored Sep 25, 2023
1 parent 6276d20 commit f5179e8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions .github/actions/setup-python-poetry/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,23 @@ 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 }}
echo "$HOME/.local/bin" >> $GITHUB_PATH
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') }}
key: poetry-local-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}-${{ hashFiles('.github/workflows/*.yml') }}

0 comments on commit f5179e8

Please sign in to comment.