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
0 commit comments