Skip to content

Commit b9418bc

Browse files
author
Fabiana Severin
committed
feat(release): gate publish on module-specific tests
- log4j2 gates on the CloudWatch integration test (reusable workflow), bound to the publish event - serialization gates on the aws-lambda-java-tests suite (version-overridden), which its own mvn verify does not run
1 parent f00150c commit b9418bc

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,20 @@ env:
5353
OIDC_ROLE_ARN: ${{ secrets.AWS_ROLE_MAVEN_RELEASE }}
5454

5555
jobs:
56+
# Pre-publish gate for log4j2: deploy a real Lambda, invoke it,
57+
# and assert the log line reaches CloudWatch. Binds the end-to-end validation
58+
# to the publish event itself. Skipped for every other module, which are
59+
# covered by their own tests (or the cross-module gate below).
60+
integration-test:
61+
if: ${{ github.event.inputs.module == 'aws-lambda-java-log4j2' }}
62+
uses: ./.github/workflows/run-integration-test.yml
63+
secrets: inherit
64+
5665
release:
66+
needs: [integration-test]
67+
# Publish when the gate passed, or when it was skipped for a non-log4j2
68+
# module. A failed or cancelled gate blocks the release.
69+
if: ${{ always() && (needs.integration-test.result == 'success' || needs.integration-test.result == 'skipped') }}
5770
runs-on: ubuntu-latest
5871
environment: Release
5972
timeout-minutes: 30
@@ -126,6 +139,28 @@ jobs:
126139
- name: Run tests
127140
run: mvn verify --file "$MODULE/pom.xml"
128141

142+
# Cross-module gate: serialization has no tests in its own build, so the
143+
# `mvn verify` above exercises nothing. Its behavioral coverage lives in
144+
# aws-lambda-java-tests, which depends on serialization via a version
145+
# property. Install the just-built serialization and run that suite
146+
# against it, so we never publish serialization the suite hasn't exercised.
147+
- name: Run cross-module test gate
148+
run: |
149+
case "$MODULE" in
150+
aws-lambda-java-serialization)
151+
MOD_VER=$(mvn -q -DforceStdout help:evaluate -Dexpression=project.version --file "$MODULE/pom.xml")
152+
MOD_VER="${MOD_VER//[$'\r\n']/}"
153+
echo "::group::Installing $MODULE $MOD_VER for the gate"
154+
mvn install -DskipTests --file "$MODULE/pom.xml"
155+
echo "::endgroup::"
156+
echo "::notice::Gating $MODULE on aws-lambda-java-tests (aws-lambda-java-serialization.version=$MOD_VER)"
157+
mvn verify -Daws-lambda-java-serialization.version="$MOD_VER" --file aws-lambda-java-tests/pom.xml
158+
;;
159+
*)
160+
echo "::notice::No cross-module test gate for $MODULE"
161+
;;
162+
esac
163+
129164
- name: Configure AWS credentials (OIDC)
130165
if: ${{ github.event.inputs.skip_publish != 'true' }}
131166
uses: ./.github/actions/configure-release-aws-credentials

0 commit comments

Comments
 (0)