Skip to content

Commit cbef6d1

Browse files
fix: handle separate dev deps
1 parent 4af6165 commit cbef6d1

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

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

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -485,20 +485,19 @@ jobs:
485485
python${{ env.PYTHON_VERSION }} -m pip install poetry==${{ env.POETRY_VERSION }} poetry-plugin-export==${{ env.POETRY_EXPORT_PLUGIN_VERSION }}
486486
poetry check
487487
poetry export --without-hashes -o package/lib/requirements.txt
488-
poetry export --without-hashes --with dev -o requirements_dev.txt
489488
fi
490-
if [ ! -f requirements_dev.txt ]; then echo no requirements;exit 0 ;fi
489+
if [ ! -f dev_deps/requirements_dev.txt ]; then echo no dev_deps/requirements;exit 0 ;fi
491490
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com
492491
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://git@github.com
493-
poetry install --with dev
492+
pip install -r dev_deps/requirements_dev.txt
494493
- name: Create directories
495494
run: |
496495
mkdir -p /opt/splunk/var/log/splunk
497496
chmod -R 777 /opt/splunk/var/log/splunk
498497
- name: Copy pytest ini
499498
run: cp tests/unit/pytest-ci.ini pytest.ini
500499
- name: Run Pytest with coverage
501-
run: poetry run pytest --cov=./ --cov-report=xml --junitxml=test-results/junit.xml tests/unit
500+
run: pytest --cov=./ --cov-report=xml --junitxml=test-results/junit.xml tests/unit
502501
- name: Job summary
503502
continue-on-error: true
504503
run: |
@@ -568,48 +567,46 @@ jobs:
568567
echo "No prod dependencies were found"
569568
rm requirements.txt
570569
fi
571-
poetry export --without-hashes --with dev -o requirements_dev.txt
572-
cat requirements_dev.txt
573570
fi
574571
- name: Setup UCC
575572
run: |
576-
if [ -f "requirements_ucc.txt" ]; then
573+
if [ -f "dev_deps/requirements_ucc.txt" ]; then
577574
python${{ env.PYTHON_VERSION }} -m venv .ucc_venv
578575
echo "Found requirements_ucc.txt. Installing UCC dependencies in an isolated environment"
579-
./.ucc_venv/bin/python -m pip install -r requirements_ucc.txt
576+
./.ucc_venv/bin/python -m pip install -r dev_deps/requirements_ucc.txt
580577
export UCC_GEN="$PWD/.ucc_venv/bin/ucc-gen"
581578
582579
if [ ! -f "$UCC_GEN" ]; then
583-
echo "ucc-gen not found after installing requirements from requirements_ucc.txt"
580+
echo "ucc-gen not found after installing requirements from dev_deps/requirements_ucc.txt"
584581
exit 1
585582
fi
586583
587584
echo "UCC_GEN=$UCC_GEN" >> "$GITHUB_ENV"
588585
else
589586
echo "No UCC requirements file found, skipping UCC setup"
590-
echo "Consider adding a requirements_ucc.txt file and place UCC requirement there, to avoid dependency conflicts"
587+
echo "Consider adding a dev_deps/requirements_ucc.txt file and place UCC requirement there, to avoid dependency conflicts"
591588
fi
592589
- name: Get pip cache dir
593590
id: pip-cache
594591
run: |
595592
echo "dir=$(pip cache dir)" >> "$GITHUB_OUTPUT"
596593
- name: Run Check there are libraries to scan
597594
id: checklibs
598-
run: if [ -f requirements_dev.txt ]; then echo "ENABLED=true" >> "$GITHUB_OUTPUT"; fi
595+
run: if [ -f dev_deps/requirements_dev.txt ]; then echo "ENABLED=true" >> "$GITHUB_OUTPUT"; fi
599596
- name: pip cache
600597
if: ${{ steps.checklibs.outputs.ENABLED == 'true' }}
601598
uses: actions/cache@v4
602599
with:
603600
path: ${{ steps.pip-cache.outputs.dir }}
604-
key: ${{ runner.os }}-pip-${{ hashFiles('requirements_dev.txt') }}
601+
key: ${{ runner.os }}-pip-${{ hashFiles('dev_deps/requirements_dev.txt') }}
605602
restore-keys: |
606603
${{ runner.os }}-pip-
607604
- name: Install deps
608605
if: ${{ steps.checklibs.outputs.ENABLED == 'true' }}
609606
run: |
610607
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf https://github.com
611608
git config --global --add url."https://${{ secrets.GH_TOKEN_ADMIN }}@github.com".insteadOf ssh://git@github.com
612-
pip install -r requirements_dev.txt
609+
pip install -r dev_deps/requirements_dev.txt
613610
- name: Semantic Release Get Next
614611
id: semantic
615612
if: github.event_name != 'pull_request'
@@ -902,11 +899,11 @@ jobs:
902899
env:
903900
PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
904901
run: |
905-
poetry install --only modinput
902+
pip install -r dev_deps/requirements_dev.txt
906903
if [ -f "tests/ucc_modinput_functional/tmp/openapi.json" ]; then
907-
poetry run ucc-test-modinput gen -o tests/ucc_modinput_functional/tmp/openapi.json -t ${{ steps.download-openapi.outputs.download-path }}/tmp/
904+
ucc-test-modinput gen -o tests/ucc_modinput_functional/tmp/openapi.json -t ${{ steps.download-openapi.outputs.download-path }}/tmp/
908905
else
909-
poetry run ucc-test-modinput gen -o ${{ steps.download-openapi.outputs.download-path }}/openapi.json -t ${{ steps.download-openapi.outputs.download-path }}/tmp/
906+
ucc-test-modinput gen -o ${{ steps.download-openapi.outputs.download-path }}/openapi.json -t ${{ steps.download-openapi.outputs.download-path }}/tmp/
910907
fi
911908
- name: upload-libs-to-s3
912909
id: upload-libs-to-s3
@@ -915,9 +912,11 @@ jobs:
915912
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
916913
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
917914
run: |
918-
poetry install --with dev
915+
python${{ env.PYTHON_VERSION }} -m venv .dev_venv
916+
echo "Found requirements_dev.txt. Installing dev dependencies in an isolated environment"
917+
./.dev_venv/bin/python -m pip install -r dev_deps/requirements_dev.txt
919918
libs_archive=libs_$(basename "$BUILD_NAME" .spl).tgz
920-
cp -r "$(find "$(poetry env info --path)" -maxdepth 3 -type d -name "site-packages")" libs/
919+
cp -r ./.dev_venv/lib/python${{ env.PYTHON_VERSION }}/site-packages/ libs/
921920
tar -czf "$libs_archive" libs
922921
aws s3 cp "$libs_archive" "s3://${{ needs.setup-workflow.outputs.s3_bucket_k8s }}/ta-apps/$libs_archive" --only-show-errors
923922
- name: upload-swagger-artifacts-to-s3

0 commit comments

Comments
 (0)