Skip to content

Commit edb9d5d

Browse files
authored
Merge pull request #694 from aws-powertools/develop
chore: Sync main with develop for release 1.18
2 parents f58075d + 17d9435 commit edb9d5d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3112
-27
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Test Examples
3131
run: dotnet test ../examples/
3232
- name: Test & Code Coverage
33-
run: dotnet test --collect:"XPlat Code Coverage" --results-directory ./codecov --verbosity normal
33+
run: dotnet test --filter "Category!=E2E" --collect:"XPlat Code Coverage" --results-directory ./codecov --verbosity normal
3434
- name: Codecov
3535
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # 4.5.0
3636
with:

.github/workflows/e2e-tests.yml

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
# PROCESS
2+
#
3+
# 1. Deploy the core and AOT stacks using the infra deployment workflow.
4+
# 2. Run the E2E tests after the infrastructure is deployed.
5+
# 3. Destroy the CDK stacks after the tests are completed.
6+
7+
# USAGE
8+
#
9+
# This workflow is triggered on push to the develop branch or manually via workflow_dispatch.
10+
11+
name: E2E Tests
12+
13+
on:
14+
workflow_dispatch:
15+
push:
16+
branches:
17+
- develop
18+
19+
permissions:
20+
id-token: write
21+
contents: read
22+
23+
jobs:
24+
deploy-stack:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
29+
30+
- name: Configure AWS credentials
31+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
32+
with:
33+
role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
34+
aws-region: us-east-1
35+
mask-aws-account-id: true
36+
37+
- name: Set up .NET
38+
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3
39+
with:
40+
dotnet-version: '8.x'
41+
42+
- name: Install CDK
43+
run: npm install -g aws-cdk
44+
45+
- name: Install AWS Lambda .NET CLI Tools
46+
run: dotnet tool install -g Amazon.Lambda.Tools
47+
48+
- name: Deploy Core Stack
49+
run: |
50+
cd libraries/tests/e2e/infra
51+
cdk deploy --require-approval never
52+
53+
# deploy-aot-stack:
54+
# runs-on: ubuntu-latest
55+
# strategy:
56+
# fail-fast: false
57+
# matrix:
58+
# architecture: [ x86_64, arm64 ]
59+
# steps:
60+
# - name: Checkout code
61+
# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
62+
#
63+
# - name: Configure AWS credentials
64+
# uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
65+
# with:
66+
# role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
67+
# aws-region: us-east-1
68+
#
69+
# - name: Set up .NET
70+
# uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3
71+
# with:
72+
# dotnet-version: '8.x'
73+
#
74+
# - name: Install CDK
75+
# run: npm install -g aws-cdk
76+
#
77+
# - name: Install AWS Lambda .NET CLI Tools
78+
# run: dotnet tool install -g Amazon.Lambda.Tools
79+
#
80+
# - name: Set up QEMU
81+
# uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a
82+
# with:
83+
# platforms: ${{ matrix.architecture }}
84+
#
85+
# - name: Set up Docker Buildx
86+
# id: builder
87+
# uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
88+
# with:
89+
# install: true
90+
# driver: docker
91+
# platforms: linux/amd64,linux/arm64
92+
#
93+
# - name: Deploy AOT Stack
94+
# run: |
95+
# cd libraries/tests/e2e/infra-aot
96+
# cdk deploy -c architecture=${{ matrix.architecture }} --require-approval never
97+
98+
run-tests:
99+
runs-on: ubuntu-latest
100+
needs: deploy-stack
101+
steps:
102+
- name: Checkout code
103+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
104+
105+
- name: Configure AWS credentials
106+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
107+
with:
108+
role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
109+
aws-region: us-east-1
110+
mask-aws-account-id: true
111+
112+
- name: Set up .NET
113+
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3
114+
with:
115+
dotnet-version: '8.x'
116+
117+
- name: Run Core Tests
118+
run: |
119+
cd libraries/tests/e2e/functions/core
120+
dotnet test
121+
122+
destroy-stack:
123+
runs-on: ubuntu-latest
124+
needs: run-tests
125+
if: always()
126+
steps:
127+
- name: Checkout code
128+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
129+
130+
- name: Configure AWS credentials
131+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
132+
with:
133+
role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
134+
aws-region: us-east-1
135+
mask-aws-account-id: true
136+
137+
- name: Install CDK
138+
run: npm install -g aws-cdk
139+
140+
- name: Install AWS Lambda .NET CLI Tools
141+
run: dotnet tool install -g Amazon.Lambda.Tools
142+
143+
- name: Destroy Core Stack
144+
run: |
145+
cd libraries/tests/e2e/infra
146+
cdk destroy --force
147+
148+
# destroy-aot-stack:
149+
# runs-on: ubuntu-latest
150+
# needs: run-tests
151+
# if: always()
152+
# strategy:
153+
# fail-fast: false
154+
# matrix:
155+
# architecture: [ x86_64, arm64 ]
156+
# steps:
157+
# - name: Checkout code
158+
# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
159+
#
160+
# - name: Configure AWS credentials
161+
# uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
162+
# with:
163+
# role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
164+
# aws-region: us-east-1
165+
# mask-aws-account-id: true
166+
#
167+
# - name: Install CDK
168+
# run: npm install -g aws-cdk
169+
#
170+
# - name: Install AWS Lambda .NET CLI Tools
171+
# run: dotnet tool install -g Amazon.Lambda.Tools
172+
#
173+
# - name: Set up QEMU
174+
# uses: docker/setup-qemu-action@53851d14592bedcffcf25ea515637cff71ef929a
175+
# with:
176+
# platforms: ${{ matrix.architecture }}
177+
#
178+
# - name: Set up Docker Buildx
179+
# id: builder
180+
# uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
181+
# with:
182+
# install: true
183+
# driver: docker
184+
# platforms: linux/amd64,linux/arm64
185+
#
186+
# - name: Destroy Core AOT Stack
187+
# run: |
188+
# cd libraries/tests/e2e/infra-aot
189+
# cdk destroy -c architecture=${{ matrix.architecture }} --force

0 commit comments

Comments
 (0)