-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added CI step for checking Poetry lock export
- Loading branch information
1 parent
0a5d34e
commit 790c4d3
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |