Skip to content

Commit 909ff58

Browse files
committed
Merge remote-tracking branch 'origin/main' into poller
2 parents a6df5b2 + fd06fb5 commit 909ff58

20 files changed

Lines changed: 408 additions & 79 deletions

File tree

.github/workflows/e2e-tests.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: E2E Tests
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
paths:
9+
- '.github/**' # for testing Github Actions
10+
- 'sdk/**'
11+
- 'sdk-testing/**'
12+
- 'sdk-integration-tests/**'
13+
- 'examples/**'
14+
- 'pom.xml'
15+
push:
16+
branches:
17+
- main
18+
paths:
19+
- '.github/**'
20+
- 'sdk/**'
21+
- 'sdk-testing/**'
22+
- 'sdk-integration-tests/**'
23+
- 'examples/**'
24+
- 'pom.xml'
25+
26+
# permission can be added at job level or workflow level
27+
permissions:
28+
id-token: write # This is required for requesting the JWT
29+
contents: read # This is required for actions/checkout
30+
31+
jobs:
32+
e2e-tests:
33+
if: github.event_name == 'pull_request'
34+
env:
35+
AWS_REGION: us-west-2
36+
runs-on: ubuntu-latest
37+
strategy:
38+
matrix:
39+
java:
40+
- 17
41+
- 21
42+
- 25
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v5
46+
- name: Setup AWS SAM CLI
47+
uses: aws-actions/setup-sam@v2
48+
with:
49+
use-installer: true
50+
# token: ${{ secrets.GITHUB_TOKEN }} # only enable if we run into throughput issues
51+
- name: Configure AWS credentials
52+
uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1
53+
with:
54+
role-to-assume: "${{ secrets.ACTIONS_INTEGRATION_ROLE_NAME }}"
55+
role-session-name: java-language-sdk-test
56+
aws-region: ${{ env.AWS_REGION }}
57+
- name: sam build
58+
run: | # add --no-cached if debugging sam build
59+
sam build --parameter-overrides \
60+
'ParameterKey=Architecture,ParameterValue=x86_64 ParameterKey=DockerFile,ParameterValue=examples/Dockerfile-java${{ matrix.java }} ParameterKey=FunctionNameSuffix,ParameterValue=-java${{ matrix.java }}'
61+
working-directory: ./examples
62+
- name: sam deploy
63+
run: |
64+
sam deploy --stack-name Java${{ matrix.java }}SDKCloudBasedIntegrationTestStack \
65+
--resolve-image-repos --resolve-s3 --capabilities CAPABILITY_IAM --parameter-overrides \
66+
'ParameterKey=Architecture,ParameterValue=x86_64 ParameterKey=DockerFile,ParameterValue=examples/Dockerfile-java${{ matrix.java }} ParameterKey=FunctionNameSuffix,ParameterValue=-java${{ matrix.java }}'
67+
working-directory: ./examples
68+
- name: Setup Java ${{ matrix.java }}
69+
uses: actions/setup-java@v5
70+
with:
71+
distribution: corretto
72+
java-version: ${{ matrix.java }}
73+
cache: maven
74+
- name: Build locally
75+
run: mvn -B -q -Dmaven.test.skip=true install --file pom.xml
76+
- name: Cloud Based Integration Tests
77+
run: mvn clean test -B -Dtest.cloud.enabled=true -Dtest=CloudBasedIntegrationTest
78+
working-directory: ./examples

examples/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ FROM amazoncorretto:17-alpine AS builder
33

44
# Install Maven
55
RUN apk add --no-cache maven
6-
76
WORKDIR /build
87

98
# Copy parent pom and all modules

examples/Dockerfile-java17

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Build stage
2+
FROM --platform=linux/amd64 amazoncorretto:17-alpine AS builder
3+
4+
WORKDIR /build
5+
6+
# Copy parent pom and all modules
7+
COPY pom.xml .
8+
COPY sdk ./sdk
9+
COPY sdk-testing ./sdk-testing
10+
COPY sdk-integration-tests ./sdk-integration-tests
11+
COPY examples ./examples
12+
13+
# Install Maven
14+
RUN apk add --no-cache maven
15+
16+
# Build and install the SDK modules first
17+
RUN mvn clean install -DskipTests -pl sdk,sdk-testing -am
18+
19+
# Build the examples project
20+
RUN mvn clean package -DskipTests -pl examples -am
21+
22+
# Runtime stage
23+
FROM public.ecr.aws/lambda/java:17
24+
25+
# Copy only the built JAR from build stage
26+
COPY --from=builder /build/examples/target/*.jar ${LAMBDA_TASK_ROOT}/lib/
27+
28+
# Default CMD (will be overridden by ImageConfig.Command in SAM template)
29+
CMD ["com.amazonaws.lambda.durable.examples.SimpleStepExample::handleRequest"]

examples/Dockerfile-java21

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Build stage
2+
FROM --platform=linux/amd64 amazoncorretto:21-alpine AS builder
3+
4+
WORKDIR /build
5+
6+
# Copy parent pom and all modules
7+
COPY pom.xml .
8+
COPY sdk ./sdk
9+
COPY sdk-testing ./sdk-testing
10+
COPY sdk-integration-tests ./sdk-integration-tests
11+
COPY examples ./examples
12+
13+
# Install Maven
14+
RUN apk add --no-cache maven
15+
16+
# Build and install the SDK modules first
17+
RUN mvn clean install -DskipTests -pl sdk,sdk-testing -am
18+
19+
# Build the examples project
20+
RUN mvn clean package -DskipTests -pl examples -am
21+
22+
# Runtime stage
23+
FROM public.ecr.aws/lambda/java:21
24+
25+
# Copy only the built JAR from build stage
26+
COPY --from=builder /build/examples/target/*.jar ${LAMBDA_TASK_ROOT}/lib/
27+
28+
# Default CMD (will be overridden by ImageConfig.Command in SAM template)
29+
CMD ["com.amazonaws.lambda.durable.examples.SimpleStepExample::handleRequest"]

examples/Dockerfile-java25

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Build stage
2+
FROM --platform=linux/amd64 amazoncorretto:25-alpine AS builder
3+
4+
WORKDIR /build
5+
6+
# Copy parent pom and all modules
7+
COPY pom.xml .
8+
COPY sdk ./sdk
9+
COPY sdk-testing ./sdk-testing
10+
COPY sdk-integration-tests ./sdk-integration-tests
11+
COPY examples ./examples
12+
13+
# Install Maven
14+
RUN apk add --no-cache maven
15+
16+
# Build and install the SDK modules first
17+
RUN mvn clean install -DskipTests -pl sdk,sdk-testing -am
18+
19+
# Build the examples project
20+
RUN mvn clean package -DskipTests -pl examples -am
21+
22+
# Runtime stage
23+
FROM public.ecr.aws/lambda/java:25
24+
25+
# Copy only the built JAR from build stage
26+
COPY --from=builder /build/examples/target/*.jar ${LAMBDA_TASK_ROOT}/lib/
27+
28+
# Default CMD (will be overridden by ImageConfig.Command in SAM template)
29+
CMD ["com.amazonaws.lambda.durable.examples.SimpleStepExample::handleRequest"]

0 commit comments

Comments
 (0)