Skip to content

Commit 0feb243

Browse files
committed
ci: run telemetry conformance via shared workflow
The workflow calls the shared telemetry suite in the conformance repository at a pinned SHA. It runs on pull requests and pushes to main that touch the SDK, the exporter, or the handler module. It also runs on manual dispatch. The prepare step installs the sdk and telemetry-exporter modules into the local Maven repository. The handler pom depends on both at the durable.sdk.version property. So the step must install them before it compiles the handlers. The handler pom reads that property from the JAVA_SDK_VERSION environment variable. The runner's sam build runs in a later step. Only GITHUB_ENV carries values to later steps. So the prepare step writes JAVA_SDK_VERSION to GITHUB_ENV.
1 parent 2294a33 commit 0feb243

2 files changed

Lines changed: 132 additions & 1 deletion

File tree

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Telemetry Conformance Tests
2+
3+
# SDK handlers and builds live here. The shared workflow deploys and validates them.
4+
5+
on:
6+
pull_request:
7+
# Include the parent PR branch while this change is stacked on PR #822.
8+
# Remove that branch filter when retargeting this PR to main.
9+
branches: [main, feat/conformance-tests-telemetry]
10+
paths:
11+
- "sdk/**"
12+
- "telemetry-exporter/**"
13+
- "conformance-tests-telemetry/**"
14+
- "pom.xml"
15+
- ".github/workflows/telemetry-conformance-tests.yml"
16+
push:
17+
branches: [main]
18+
paths:
19+
- "sdk/**"
20+
- "telemetry-exporter/**"
21+
- "conformance-tests-telemetry/**"
22+
- "pom.xml"
23+
- ".github/workflows/telemetry-conformance-tests.yml"
24+
workflow_dispatch:
25+
inputs:
26+
aws_region:
27+
description: AWS region
28+
required: true
29+
default: us-west-2
30+
type: string
31+
conformance_test_ref:
32+
description: Optional conformance test commit SHA or branch name. Empty uses the shared workflow commit.
33+
required: false
34+
type: string
35+
default: ""
36+
37+
permissions: {}
38+
39+
jobs:
40+
telemetry:
41+
# 1. Run for non-PR events, such as pushes and manual invocations.
42+
# 2. For PRs, run only same-repo branches from non-Dependabot actors. Forked PRs and Dependabot cannot read secrets.
43+
if: github.event_name != 'pull_request' || (github.actor != 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository)
44+
permissions:
45+
contents: read
46+
id-token: write
47+
# The pinned SHA also selects the runner and telemetry-extension revision the shared
48+
# workflow installs, so it must be reachable from a branch. It is the head of
49+
# aws-durable-execution-conformance-tests PR #150; re-pin to that PR's merge commit once it lands.
50+
uses: aws/aws-durable-execution-conformance-tests/.github/workflows/telemetry-suite.yml@3e4fdaf0dda35ed8f64fb0d18365ef05a6a447fe
51+
with:
52+
language: java
53+
resource_prefix: java
54+
sdk_repository: aws/aws-durable-execution-sdk-java
55+
sdk_ref: ${{ github.event.pull_request.head.sha || github.sha }}
56+
# Path relative to the conformance workspace, where this repo is checked out at .build/durable-sdk.
57+
examples_dir: .build/durable-sdk/conformance-tests-telemetry
58+
conformance_test_ref: ${{ inputs.conformance_test_ref }}
59+
aws_region: ${{ inputs.aws_region || 'us-west-2' }}
60+
runs_on: codebuild-github-actions-runner-${{ github.run_id }}-${{ github.run_attempt }}
61+
timeout_minutes: 30
62+
setup_command: |
63+
set -euo pipefail
64+
if [ -n "${JAVA_HOME_21_X64:-}" ]; then
65+
export JAVA_HOME="$JAVA_HOME_21_X64"
66+
elif [ -x /usr/lib/jvm/java-21-amazon-corretto/bin/java ]; then
67+
export JAVA_HOME=/usr/lib/jvm/java-21-amazon-corretto
68+
elif [ -z "${JAVA_HOME:-}" ]; then
69+
export JAVA_HOME="$(dirname "$(dirname "$(readlink -f "$(command -v java)")")")"
70+
fi
71+
if [ ! -x "$JAVA_HOME/bin/java" ] || [ ! -x "$JAVA_HOME/bin/javac" ]; then
72+
echo "Selected JAVA_HOME=$JAVA_HOME is not a complete JDK"
73+
exit 1
74+
fi
75+
export PATH="$JAVA_HOME/bin:$PATH"
76+
java_spec=$(java -XshowSettings:properties -version 2>&1 | awk '$1 == "java.specification.version" {print $3}')
77+
if [ "$java_spec" != "21" ]; then
78+
echo "Java 21 is required; selected JAVA_HOME=$JAVA_HOME reports specification version $java_spec"
79+
exit 1
80+
fi
81+
javac_version=$(javac -version 2>&1)
82+
if [[ ! "$javac_version" =~ ^javac[[:space:]]21([.]|[[:space:]]|$) ]]; then
83+
echo "Java 21 javac is required; selected compiler reports $javac_version"
84+
exit 1
85+
fi
86+
java -version
87+
javac -version
88+
if [ -n "${GITHUB_ENV:-}" ]; then
89+
echo "JAVA_HOME=$JAVA_HOME" >> "$GITHUB_ENV"
90+
fi
91+
if [ -n "${GITHUB_PATH:-}" ]; then
92+
echo "$JAVA_HOME/bin" >> "$GITHUB_PATH"
93+
fi
94+
prepare_command: |
95+
JAVA_SDK_VERSION=$(
96+
mvn -B -q \
97+
--file "$SDK_CHECKOUT/pom.xml" \
98+
-Dstyle.color=never \
99+
-Dexpression=project.version \
100+
-DforceStdout \
101+
help:evaluate
102+
)
103+
mvn -B -q \
104+
--file "$SDK_CHECKOUT/pom.xml" \
105+
--projects sdk,telemetry-exporter \
106+
--also-make \
107+
-DskipTests \
108+
install
109+
echo "Using Java SDK version $JAVA_SDK_VERSION"
110+
# The runner's sam build runs in a later step. Only GITHUB_ENV carries the version to it.
111+
echo "JAVA_SDK_VERSION=$JAVA_SDK_VERSION" >> "$GITHUB_ENV"
112+
mvn -B -q -DskipTests package \
113+
-Ddurable.sdk.version="$JAVA_SDK_VERSION" \
114+
--file "$EXAMPLES_DIR/pom.xml"
115+
secrets:
116+
CONFORMANCE_TEST_ROLE_ARN: ${{ secrets.TEST_ROLE_ARN }}
117+
CONFORMANCE_TEST_ACCOUNT_ID: ${{ secrets.TEST_ACCOUNT_ID }}
118+
CONFORMANCE_TEST_LAMBDA_EXECUTION_ROLE_ARN: ${{ secrets.TEST_LAMBDA_EXECUTION_ROLE_ARN }}

‎conformance-tests-telemetry/README.md‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,17 @@ durable-execution-conformance \
7272
--parameter-overrides LambdaExecutionRoleArn=<role-arn>
7373
```
7474

75-
A caller GitHub workflow is a follow-on.
75+
## CI
76+
77+
[`.github/workflows/telemetry-conformance-tests.yml:1–118`](../.github/workflows/telemetry-conformance-tests.yml#L1-L118)
78+
runs on pull requests and pushes to `main` that touch the SDK, telemetry
79+
exporter, this module, or the root `pom.xml`. It also supports manual dispatch.
80+
81+
It calls the conformance repository's reusable telemetry workflow at a pinned
82+
SHA. `sdk_ref` selects the PR head commit, and `examples_dir` points to this
83+
module. CI installs the SDK and exporter, compiles the handlers, then deploys
84+
the template and validates the `telemetry` suite. Reports and execution
85+
histories are uploaded as artifacts.
86+
87+
CI assumes AWS credentials through OIDC using the repository's existing test
88+
secrets. Fork and Dependabot pull requests skip the cloud job.

0 commit comments

Comments
 (0)