Skip to content

Commit

Permalink
Try to set up better caching
Browse files Browse the repository at this point in the history
  • Loading branch information
znicholls committed Jan 19, 2024
1 parent 781bb2c commit 2e04a2d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,31 @@ runs:
which poetry
poetry --version # Check poetry installation
- name: Set up Python ${{ inputs.python-version }}
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
cache: poetry
- name: Set Poetry environment
shell: bash
run: |
# This line used to be needed, but seems to have been
# sorted with newer poetry versions. The check is whether
# the right version of python is shown below after running
# `poetry run which python` and whether the right version
# of python is used in the tests
# poetry env use "python${{ inputs.python-version }}"
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Install dependencies
if: ${{ inputs.run-poetry-install == 'true' }}
if: ${{ inputs.run-poetry-install == 'true' }} && ${{ steps.setup-python.outputs.cache-hit != 'true' }}
shell: bash
run: |
poetry install --no-interaction --no-root ${{ inputs.poetry-dependency-install-flags }}
poetry run python --version
# Now run same command but let the package install too
- name: Install package
if: ${{ inputs.run-poetry-install == 'true' }}
shell: bash
run: |
poetry install --no-interaction ${{ inputs.poetry-dependency-install-flags }}
poetry run python --version # Check python version just in case

0 comments on commit 2e04a2d

Please sign in to comment.