NR-352205 test cases for remaining stacks #103
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: E2E Test Workflow | |
on: | |
pull_request: | |
branches: | |
- develop | |
- main | |
jobs: | |
build-templates: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: write | |
strategy: | |
matrix: | |
TEMPLATE_FILE: [logging-lambda-firehose-template, logging-lambda-metric-polling, logging-lambda-metric-stream, logging-firehose-metric-polling] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- name: Install AWS SAM CLI | |
run: | | |
pip install aws-sam-cli | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
role-to-assume: ${{ secrets.AWS_E2E_ROLE }} | |
aws-region: us-east-1 | |
- name: Build SAM Application | |
env: | |
S3_BUCKET: unified-lambda-e2e-test-templates | |
run: | | |
sam build -u --template-file "${{ matrix.TEMPLATE_FILE }}.yaml" --build-dir ".aws-sam/build/${{ matrix.TEMPLATE_FILE }}" | |
sam package --s3-bucket "$S3_BUCKET" --template-file ".aws-sam/build/${{ matrix.TEMPLATE_FILE }}/template.yaml" --output-template-file ".aws-sam/build/${{ matrix.TEMPLATE_FILE }}/${{ matrix.TEMPLATE_FILE }}.yaml" | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.TEMPLATE_FILE }}.yaml | |
path: .aws-sam/build/${{ matrix.TEMPLATE_FILE }}/${{ matrix.TEMPLATE_FILE }}.yaml | |
run-e2e-tests-lambda-firehose-metrics: | |
needs: [build-templates] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: write | |
strategy: | |
matrix: | |
test-case: [test_for_lambda_firehose_stack, test_for_lambda_metrics_polling_stack, test_for_lambda_metrics_streaming_stack, test_for_firehose_metric_polling_stack] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
path: build-artifact | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- name: Install AWS SAM CLI | |
run: | | |
pip install aws-sam-cli | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
role-to-assume: ${{ secrets.AWS_E2E_ROLE }} | |
aws-region: us-east-1 | |
- name: Run e2e tests | |
env: | |
NEW_RELIC_USER_KEY: ${{ secrets.NEW_RELIC_USER_KEY }} | |
NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }} | |
run: | | |
cd e2e-tests/ | |
./lambda-with-metrics-test.sh ${{ matrix.test-case }} | |
clean-up: | |
# needs: [run-e2e-tests-cloudwatch, run-e2e-tests-s3] | |
needs: [ run-e2e-tests-lambda-firehose-metrics ] | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- name: Install AWS SAM CLI | |
run: | | |
pip install aws-sam-cli | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
role-to-assume: ${{ secrets.AWS_E2E_ROLE }} | |
aws-region: us-east-1 | |
- name: Delete Resources | |
env: | |
S3_BUCKET: unified-lambda-e2e-test-templates | |
run: | |
aws s3 rm "s3://$S3_BUCKET" --recursive |