Skip to content

Commit

Permalink
can I cache pipx and poetry as well?
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeAeich committed May 23, 2024
1 parent a7b3977 commit 4bbcab0
Showing 1 changed file with 65 additions and 3 deletions.
68 changes: 65 additions & 3 deletions .github/workflows/code_quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,39 @@ jobs:
with:
python-version: '3.11'

- name: Setup Local Variables
id: variable-setup
run: |
echo "pipx-home=$PIPX_HOME" >> $GITHUB_OUTPUT
echo "pipx-bin-dir=$PIPX_BIN_DIR" >> $GITHUB_OUTPUT
export BASE64_PIPX_ID=$(echo -n '${{ inputs.pipx-packages }}' | base64)
echo "cache-key-pipx=pipx-${{ inputs.os }}-${{ inputs.python-version }}-$BASE64_PIPX_ID" >> $GITHUB_OUTPUT
shell: bash

- name: Cache pipx
id: cache-pipx
uses: actions/cache@v4
with:
path: |
${{ steps.variable-setup.outputs.pipx-home }}
${{ steps.variable-setup.outputs.pipx-bin-dir }}
key: ${{ steps.variable-setup.outputs.cache-key-pipx }}

- name: Install Poetry ${{ inputs.poetry-version }} and '${{ inputs.pipx-packages }}'
if: ${{ steps.cache-pipx.outputs.cache-hit != 'true' }}
run: |
for tool in ${{ inputs.pipx-packages }}; do;
pipx install $tool
done
shell: bash

- name: Install Poetry
run: pipx install poetry
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: |
python -m pip install --user pipx
python -m pipx ensurepath
pipx install poetry
- name: Generate hash of lint dependencies only
run: |
Expand Down Expand Up @@ -95,8 +126,39 @@ jobs:
with:
python-version: '3.11'

- name: Install poetry
run: pipx install poetry
- name: Setup Local Variables
id: variable-setup
run: |
echo "pipx-home=$PIPX_HOME" >> $GITHUB_OUTPUT
echo "pipx-bin-dir=$PIPX_BIN_DIR" >> $GITHUB_OUTPUT
export BASE64_PIPX_ID=$(echo -n '${{ inputs.pipx-packages }}' | base64)
echo "cache-key-pipx=pipx-${{ inputs.os }}-${{ inputs.python-version }}-$BASE64_PIPX_ID" >> $GITHUB_OUTPUT
shell: bash

- name: Cache pipx
id: cache-pipx
uses: actions/cache@v4
with:
path: |
${{ steps.variable-setup.outputs.pipx-home }}
${{ steps.variable-setup.outputs.pipx-bin-dir }}
key: ${{ steps.variable-setup.outputs.cache-key-pipx }}

- name: Install Poetry ${{ inputs.poetry-version }} and '${{ inputs.pipx-packages }}'
if: ${{ steps.cache-pipx.outputs.cache-hit != 'true' }}
run: |
for tool in ${{ inputs.pipx-packages }}; do;
pipx install $tool
done
shell: bash

- name: Install Poetry
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: |
python -m pip install --user pipx
python -m pipx ensurepath
pipx install poetry
- name: Generate hash of types dependencies only
run: |
Expand Down

0 comments on commit 4bbcab0

Please sign in to comment.