|
53 | 53 | OIDC_ROLE_ARN: ${{ secrets.AWS_ROLE_MAVEN_RELEASE }} |
54 | 54 |
|
55 | 55 | 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 | + |
56 | 65 | 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') }} |
57 | 70 | runs-on: ubuntu-latest |
58 | 71 | environment: Release |
59 | 72 | timeout-minutes: 30 |
@@ -126,6 +139,28 @@ jobs: |
126 | 139 | - name: Run tests |
127 | 140 | run: mvn verify --file "$MODULE/pom.xml" |
128 | 141 |
|
| 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 | +
|
129 | 164 | - name: Configure AWS credentials (OIDC) |
130 | 165 | if: ${{ github.event.inputs.skip_publish != 'true' }} |
131 | 166 | uses: ./.github/actions/configure-release-aws-credentials |
|
0 commit comments