From c8fdd71cf1863b1876975a8a1b6393ae25eefb2c Mon Sep 17 00:00:00 2001 From: mkolasinski-splunk <105011638+mkolasinski-splunk@users.noreply.github.com> Date: Tue, 26 Mar 2024 08:43:40 +0100 Subject: [PATCH] chore: move poetry lock --check to unit tests job Poetry is being used for deps installation in unit tests jobs before build job, hence moving poetry lock --check to unit tests jobs. --- .../workflows/reusable-build-test-release.yml | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/reusable-build-test-release.yml b/.github/workflows/reusable-build-test-release.yml index ea4699ff2..effd0933d 100644 --- a/.github/workflows/reusable-build-test-release.yml +++ b/.github/workflows/reusable-build-test-release.yml @@ -464,12 +464,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://git@github.com @@ -514,12 +515,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://git@github.com @@ -572,7 +574,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