Skip to content

Commit

Permalink
Added CI step for checking Poetry lock export
Browse files Browse the repository at this point in the history
  • Loading branch information
dennissiemensma committed Feb 23, 2024
1 parent 0a5d34e commit 790c4d3
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/poetry-requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Poetry requirements

on:
push:
branches:
- 'development'

jobs:
check_poetry_requirements:
name: 'Python ${{ matrix.python-version }}'
runs-on: ubuntu-latest
timeout-minutes: 10 # Don't run forever when stale
strategy:
matrix:
python-version:
- '3.11'
steps:
- uses: actions/checkout@v4

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Cached dependencies & virtualenv
uses: actions/cache@v4
with:
path: |
~/.cache/pypoetry/
~/dsmr-reader/.venv
key: dependencies-update-check-${{ hashFiles('poetry.lock') }}

- name: Export Poetry lock file
run: |
pip install --upgrade pip poetry
poetry self add poetry-plugin-export
poetry config virtualenvs.in-project true
poetry check
poetry run pip install -r
poetry export -f requirements.txt --without-urls --without-hashes --without dev --output poetry-export-base.txt
poetry export -f requirements.txt --without-urls --without-hashes --only dev --output poetry-export-dev.txt
- name: Compare Poetry export with requirements files
run: |
diff poetry-export-base.txt $GITHUB_WORKSPACE/dsmrreader/provisioning/requirements/base.txt
diff poetry-export-dev.txt $GITHUB_WORKSPACE/dsmrreader/provisioning/requirements/dev.txt

0 comments on commit 790c4d3

Please sign in to comment.