Skip to content

Commit 487cbaa

Browse files
Feature/eja trial regression test workflow (#354)
* Amending regresion tests to see if can trigger without additional approval * amending regression test to install poetry into setup-python version of python * reverted python/poetry step (hopefully we didn't need to change this) added check-licenses to make file updated script * returned the echo which states which environment the tests will run in * moving pip-licences to dev dependencies * updating poetry lock --------- Co-authored-by: SeanSteberis <[email protected]>
1 parent 99d0663 commit 487cbaa

File tree

6 files changed

+115
-24
lines changed

6 files changed

+115
-24
lines changed

.github/workflows/cicd-3-test.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,11 @@ jobs:
130130
echo "Running: make terraform env=$ENVIRONMENT workspace=$WORKSPACE stack=api-layer tf-command=apply"
131131
make terraform env=$ENVIRONMENT stack=api-layer tf-command=apply workspace=$WORKSPACE
132132
working-directory: ./infrastructure
133-
134-
- name: "Regression Tests"
135-
uses: ./.github/workflows/regression-tests.yml
136-
with:
137-
ENVIRONMENT: "test"
138-
VERSION_NUMBER: "main"
133+
regression-tests:
134+
name: "Regression Tests"
135+
needs: deploy
136+
uses: ./.github/workflows/regression-tests.yml
137+
with:
138+
ENVIRONMENT: "test"
139+
VERSION_NUMBER: "main"
140+
secrets: inherit

.github/workflows/regression-tests.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,15 @@ on:
1111
type: string
1212
PRODUCT:
1313
type: string
14-
secrets: {}
15-
14+
secrets: { }
1615

1716
jobs:
1817
regression-tests:
19-
runs-on: ubuntu-latest
20-
environment: ${{ inputs.ENVIRONMENT }}
21-
18+
runs-on: ubuntu-22.04
2219
steps:
23-
- name: Checkout local github actions
20+
- name: Checkout
2421
uses: actions/checkout@v5
2522
with:
26-
ref: ${{ env.BRANCH_NAME }}
2723
fetch-depth: 0
2824

2925
- name: Cache asdf
@@ -35,15 +31,14 @@ jobs:
3531
restore-keys: |
3632
${{ runner.os }}-asdf-
3733
38-
- name: Install asdf dependencies in .tool-versions
34+
- name: Install asdf tools
3935
uses: asdf-vm/actions/install@1902764435ca0dd2f3388eea723a4f92a4eb8302
4036
with:
4137
asdf_branch: v0.15.0
4238
env:
4339
PYTHON_CONFIGURE_OPTS: --enable-shared
4440

45-
# Use grep to find the line beginning with "python"
46-
- name: Get Python version from file
41+
- name: Derive Python version from .tool-versions
4742
run: |
4843
PYTHON_VERSION=$(grep "^python" .tool-versions | sed 's/python //g')
4944
echo "PYTHON_VERSION=$PYTHON_VERSION" >> $GITHUB_ENV
@@ -66,6 +61,6 @@ jobs:
6661
run: |
6762
echo Running regression tests in the "$TARGET_ENVIRONMENT" environment.
6863
poetry run python run_regression_tests.py \
69-
--env="$TARGET_ENVIRONMENT" \
70-
--token="$TESTS_TOKEN" \
71-
--regression_test_repo_tag "$VERSION_NUMBER"
64+
--env="$TARGET_ENVIRONMENT" \
65+
--token="$TESTS_TOKEN" \
66+
--regression_test_repo_tag "$VERSION_NUMBER"

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ _dist_include="pytest.ini poetry.lock poetry.toml pyproject.toml Makefile build/
3636
dependencies: # Install dependencies needed to build and test the project @Pipeline
3737
scripts/dependencies.sh
3838

39+
check-licenses:
40+
scripts/check_python_licenses.sh
41+
3942
.PHONY: build
4043
build: dist/lambda.zip # Build lambda.zip in dist/
4144

poetry.lock

Lines changed: 93 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ behave = "^1.2.6"
6464
boto3 = "^1.38.42"
6565
python-dotenv = "^1.1.1"
6666
openapi-spec-validator = "^0.7.2"
67+
pip-licenses = "^5.0.0"
68+
6769

6870
[tool.poetry-plugin-lambda-build]
6971
docker-image = "public.ecr.aws/sam/build-python3.13:1.139-x86_64" # See https://gallery.ecr.aws/search?searchTerm=%22python%22&architecture=x86-64&popularRegistries=amazon&verified=verified&operatingSystems=Linux

scripts/check_python_licenses.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ LICENSES=$(poetry run pip-licenses --ignore-packages "${IGNORE_PACKAGES}")
77
INCOMPATIBLE_LIBS=$(echo "$LICENSES" | grep 'GPL' || true)
88

99
if [[ -z $INCOMPATIBLE_LIBS ]]; then
10+
echo "The libraries were checked and no license issues were found."
1011
exit 0
1112
else
1213
echo "The following libraries were found which are not compatible with this project's license:"

0 commit comments

Comments
 (0)