Skip to content

Commit

Permalink
Don't install pipx again
Browse files Browse the repository at this point in the history
  • Loading branch information
KapJI committed Sep 11, 2024
1 parent c31a2eb commit 5b8e466
Showing 1 changed file with 37 additions and 4 deletions.
41 changes: 37 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,40 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Setup environtment
shell: bash
run: |
PIPX_HOME="$HOME/.pipx"
PIPX_BIN_DIR="$PIPX_HOME/bin"
echo "PIPX_HOME=$PIPX_HOME" >> $GITHUB_ENV
echo "PIPX_BIN_DIR=$PIPX_BIN_DIR" >> $GITHUB_ENV
echo "$PIPX_BIN_DIR" >> $GITHUB_PATH
echo "$(python3 -m site --user-base)/bin" >> $GITHUB_PATH
- name: Get pipx and poetry latest versions
id: latest-versions
run: |
pipx_version=$(curl -s https://pypi.org/pypi/pipx/json | jq -r .info.version)
poetry_version=$(curl -s https://pypi.org/pypi/poetry/json | jq -r .info.version)
echo "pipx=$pipx_version" >> $GITHUB_OUTPUT
echo "poetry=$poetry_version" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Cache Poetry
with:
path: ~/.pipx/
key: >
${{ format('pipx-{0}-{1}-{2}',
matrix.os,
matrix.python-version,
steps.latest-versions.outputs.poetry,
) }}
- name: Install pipx
run: pip install --user pipx

- name: Install Poetry
uses: abatilo/actions-poetry@v3
run: pipx install poetry

- name: Use local virtual environment
run: |
Expand All @@ -45,9 +77,10 @@ jobs:
venv-${{ matrix.os }}-${{ matrix.python-version }}-
- name: Install dependencies with Poetry
if: steps.cache-poetry-deps.outputs.cache-hit != 'true'
run: poetry install
run: |
poetry env use python3
poetry install
- name: Test package building
- name: Check if package builds
run: |
poetry build

0 comments on commit 5b8e466

Please sign in to comment.