Skip to content

Commit 9b8154c

Browse files
fix: move poetry lock --check to unit tests job (#245)
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
1 parent d4002b6 commit 9b8154c

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

.github/workflows/reusable-build-test-release.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -471,12 +471,13 @@ jobs:
471471
- name: Setup addon
472472
run: |
473473
if [ -f "poetry.lock" ]
474-
then
475-
mkdir -p package/lib || true
476-
pip install poetry==1.5.1 poetry-plugin-export==1.4.0
477-
poetry export --without-hashes -o package/lib/requirements.txt
478-
poetry export --without-hashes --dev -o requirements_dev.txt
479-
fi
474+
then
475+
mkdir -p package/lib || true
476+
pip install poetry==1.5.1 poetry-plugin-export==1.4.0
477+
poetry lock --check
478+
poetry export --without-hashes -o package/lib/requirements.txt
479+
poetry export --without-hashes --dev -o requirements_dev.txt
480+
fi
480481
if [ ! -f requirements_dev.txt ]; then echo no requirements;exit 0 ;fi
481482
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com
482483
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://git@github.com
@@ -521,12 +522,13 @@ jobs:
521522
- name: Setup addon
522523
run: |
523524
if [ -f "poetry.lock" ]
524-
then
525-
mkdir -p package/lib || true
526-
pip install poetry==1.5.1 poetry-plugin-export==1.4.0
527-
poetry export --without-hashes -o package/lib/requirements.txt
528-
poetry export --without-hashes --dev -o requirements_dev.txt
529-
fi
525+
then
526+
mkdir -p package/lib || true
527+
pip install poetry==1.5.1 poetry-plugin-export==1.4.0
528+
poetry lock --check
529+
poetry export --without-hashes -o package/lib/requirements.txt
530+
poetry export --without-hashes --dev -o requirements_dev.txt
531+
fi
530532
if [ ! -f requirements_dev.txt ]; then echo no requirements;exit 0 ;fi
531533
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com
532534
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://git@github.com
@@ -579,7 +581,6 @@ jobs:
579581
then
580582
echo " poetry.lock found "
581583
sudo pip3 install poetry==1.5.1 poetry-plugin-export==1.4.0
582-
poetry lock --check
583584
poetry export --without-hashes -o requirements.txt
584585
if [ "$(grep -cve '^\s*$' requirements.txt)" -ne 0 ]
585586
then

0 commit comments

Comments
 (0)