Skip to content

Commit

Permalink
fail job if poetry lock needs to be updated
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwojcik committed Nov 9, 2024
1 parent c4ccc06 commit f37717d
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ jobs:
- name: Install DRF version
run: poetry run pip install --upgrade "djangorestframework==${{ matrix.drf-version }}"

- name: Check if poetry.lock needs to be updated
run: |
git diff --exit-code poetry.lock || echo "poetry.lock has changed, please update it" && exit 1
- name: Show environment info
run: |
poetry run python --version
Expand Down Expand Up @@ -122,3 +118,34 @@ jobs:

- name: Run pre-commit
run: make run-hooks

lock-file-check:
name: Check poetry.lock for changes
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-lock-check-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-lock-check-
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.7.1"

- name: Install dependencies to check poetry.lock
run: poetry install --no-dev

- name: Check if poetry.lock needs to be updated
run: |
git diff --exit-code poetry.lock || echo "poetry.lock has changed, please update it" && exit 1

0 comments on commit f37717d

Please sign in to comment.