Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ runs:
path: ${{ steps.poetry-venvs.outputs.dir }}
key: poetry-venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Check that the poetry lockfile is up to date
# This is rather hacky. We look for the warning message in poetry's
# output. We really want to use `poetry lock --check`, but that is only
# available in poetry 1.2.
# https://github.com/python-poetry/poetry/issues/1406
run: >-
poetry export --without-hashes | (! grep "The lock file is not up to date") ||
(echo pyproject.toml was updated without running \`poetry lock --no-update\`. && false)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you were feeling particularly fancy, you could make this set an error annotation on poetry.lock: see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message

(But I don't think we need to be fancy)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh, I didn't know you could do that with GHA. I'll leave the fanciness alone for now.

shell: bash

- name: Install dependencies
if: "${{ steps.poetry-venv-cache.outputs.cache-hit != 'true' }}"
run: poetry install --no-interaction --no-root
Expand Down