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