Skip to content

Commit

Permalink
fix: move poetry lock --check to unit tests job (#245)
Browse files Browse the repository at this point in the history
Poetry is being used for deps installation in unit tests jobs before
build job, hence moving poetry lock --check to unit tests jobs.

Test run:
splunk/splunk-add-on-for-google-workspace#543
  • Loading branch information
mkolasinski-splunk authored Mar 29, 2024
1 parent d4002b6 commit 9b8154c
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/reusable-build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -471,12 +471,13 @@ jobs:
- name: Setup addon
run: |
if [ -f "poetry.lock" ]
then
mkdir -p package/lib || true
pip install poetry==1.5.1 poetry-plugin-export==1.4.0
poetry export --without-hashes -o package/lib/requirements.txt
poetry export --without-hashes --dev -o requirements_dev.txt
fi
then
mkdir -p package/lib || true
pip install poetry==1.5.1 poetry-plugin-export==1.4.0
poetry lock --check
poetry export --without-hashes -o package/lib/requirements.txt
poetry export --without-hashes --dev -o requirements_dev.txt
fi
if [ ! -f requirements_dev.txt ]; then echo no requirements;exit 0 ;fi
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://[email protected]
Expand Down Expand Up @@ -521,12 +522,13 @@ jobs:
- name: Setup addon
run: |
if [ -f "poetry.lock" ]
then
mkdir -p package/lib || true
pip install poetry==1.5.1 poetry-plugin-export==1.4.0
poetry export --without-hashes -o package/lib/requirements.txt
poetry export --without-hashes --dev -o requirements_dev.txt
fi
then
mkdir -p package/lib || true
pip install poetry==1.5.1 poetry-plugin-export==1.4.0
poetry lock --check
poetry export --without-hashes -o package/lib/requirements.txt
poetry export --without-hashes --dev -o requirements_dev.txt
fi
if [ ! -f requirements_dev.txt ]; then echo no requirements;exit 0 ;fi
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://[email protected]
Expand Down Expand Up @@ -579,7 +581,6 @@ jobs:
then
echo " poetry.lock found "
sudo pip3 install poetry==1.5.1 poetry-plugin-export==1.4.0
poetry lock --check
poetry export --without-hashes -o requirements.txt
if [ "$(grep -cve '^\s*$' requirements.txt)" -ne 0 ]
then
Expand Down

0 comments on commit 9b8154c

Please sign in to comment.