Skip to content

Merge pull request #968 from aws-powertools/feature/idempotency-hooks #73

Merge pull request #968 from aws-powertools/feature/idempotency-hooks

Merge pull request #968 from aws-powertools/feature/idempotency-hooks #73

Workflow file for this run

# PROCESS
#
# 1. Deploy the E2E stacks using the infra deployment workflow for non-aot and aot.
# 2. Run the E2E tests after the infrastructure is deployed.
# 3. Destroy the CDK stacks after the tests are completed.
# USAGE
#
# This workflow is triggered on push to the develop branch or manually via workflow_dispatch.
name: E2E Tests
on:
workflow_dispatch:
push:
paths:
- "libraries/**"
branches:
- develop
concurrency:
group: e2e
permissions:
contents: read
jobs:
deploy-stack:
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
with:
role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
aws-region: us-east-1
mask-aws-account-id: true
- name: Set up .NET
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # 4.3.1
with:
dotnet-version: '8.x'
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "22"
- name: Setup dependencies
uses: aws-powertools/actions/.github/actions/cached-node-modules@3b5b8e2e58b7af07994be982e83584a94e8c76c5
- name: Install AWS Lambda .NET CLI Tools
run: dotnet tool install -g Amazon.Lambda.Tools
- name: Deploy Stack
run: |
cd libraries/tests/e2e/infra
npx cdk deploy --all --require-approval never
deploy-aot-stack:
permissions:
id-token: write
strategy:
matrix:
os: [ubuntu-24.04-arm, ubuntu-latest]
include:
- os: ubuntu-24.04-arm
arch: arm64
- os: ubuntu-latest
arch: x86_64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
with:
role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
aws-region: us-east-1
mask-aws-account-id: true
- name: Set up .NET
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # 4.3.1
with:
dotnet-version: '8.x'
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "22"
- name: Setup dependencies
uses: aws-powertools/actions/.github/actions/cached-node-modules@3b5b8e2e58b7af07994be982e83584a94e8c76c5
- name: Install AWS Lambda .NET CLI Tools
run: dotnet tool install -g Amazon.Lambda.Tools
- name: Deploy AOT Stack
run: |
cd libraries/tests/e2e/infra-aot
npx cdk deploy --all -c architecture=${{ matrix.arch }} --require-approval never
run-tests:
permissions:
id-token: write
strategy:
matrix:
utility: [core, idempotency]
runs-on: ubuntu-latest
needs: [deploy-stack,deploy-aot-stack]
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
with:
role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
aws-region: us-east-1
mask-aws-account-id: true
- name: Set up .NET
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # 4.3.1
with:
dotnet-version: '8.x'
- name: Run Tests
run: |
cd libraries/tests/e2e/functions/${{ matrix.utility }}
dotnet test --filter Category!=AOT
- name: Run AOT Tests
run: |
cd libraries/tests/e2e/functions/${{ matrix.utility }}
dotnet test --filter Category=AOT
destroy-stack:
permissions:
id-token: write
runs-on: ubuntu-latest
needs: run-tests
if: always()
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
with:
role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
aws-region: us-east-1
mask-aws-account-id: true
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "22"
- name: Setup dependencies
uses: aws-powertools/actions/.github/actions/cached-node-modules@3b5b8e2e58b7af07994be982e83584a94e8c76c5
- name: Install AWS Lambda .NET CLI Tools
run: dotnet tool install -g Amazon.Lambda.Tools
- name: Destroy Stack
run: |
cd libraries/tests/e2e/infra
npx cdk destroy --all --force
destroy-aot-stack:
permissions:
id-token: write
strategy:
matrix:
os: [ubuntu-24.04-arm, ubuntu-latest]
include:
- os: ubuntu-24.04-arm
arch: arm64
- os: ubuntu-latest
arch: x86_64
runs-on: ${{ matrix.os }}
needs: run-tests
if: always()
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
with:
role-to-assume: ${{ secrets.E2E_DEPLOY_ROLE }}
aws-region: us-east-1
mask-aws-account-id: true
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "22"
- name: Setup dependencies
uses: aws-powertools/actions/.github/actions/cached-node-modules@3b5b8e2e58b7af07994be982e83584a94e8c76c5
- name: Install AWS Lambda .NET CLI Tools
run: dotnet tool install -g Amazon.Lambda.Tools
- name: Destroy arm64 AOT Stack
run: |
cd libraries/tests/e2e/infra-aot
npx cdk destroy --all -c architecture=${{ matrix.arch }} --force