Run e2e Tests #544
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: Run e2e Tests | |
on: | |
workflow_dispatch: | |
inputs: | |
prNumber: | |
description: '(Optional) PR Number. If you specify a value the value of the branch field will be ignored.' | |
required: false | |
default: '' | |
permissions: | |
contents: read | |
jobs: | |
run-e2e-tests-on-utils: | |
runs-on: ubuntu-latest | |
env: | |
NODE_ENV: dev | |
PR_NUMBER: ${{ inputs.prNumber }} | |
permissions: | |
id-token: write # needed to interact with GitHub's OIDC Token endpoint. | |
contents: read | |
strategy: | |
max-parallel: 30 | |
matrix: | |
package: | |
[ | |
layers, | |
packages/logger, | |
packages/metrics, | |
packages/tracer, | |
packages/parameters, | |
packages/idempotency, | |
] | |
version: [18, 20] | |
arch: [x86_64, arm64] | |
fail-fast: false | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
# If we pass a PR Number when triggering the workflow we will retrieve the PR info and get its headSHA | |
- name: Extract PR details | |
id: extract_PR_details | |
if: ${{ inputs.prNumber != '' }} | |
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
with: | |
script: | | |
const script = require('.github/scripts/get_pr_info.js'); | |
await script({github, context, core}); | |
# Only if a PR Number was passed and the headSHA of the PR extracted, | |
# we checkout the PR at that point in time | |
- name: Checkout PR code | |
if: ${{ inputs.prNumber != '' }} | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
ref: ${{ steps.extract_PR_details.outputs.headSHA }} | |
- name: Setup NodeJS | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0 | |
with: | |
node-version: '20' | |
- name: Setup dependencies | |
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872 | |
with: | |
nodeVersion: '20' | |
- name: Setup AWS credentials | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }} | |
aws-region: eu-west-1 | |
mask-aws-account-id: true | |
- name: Run integration tests on utils | |
env: | |
RUNTIME: nodejs${{ matrix.version }}x | |
CI: true | |
ARCH: ${{ matrix.arch }} | |
JSII_SILENCE_WARNING_DEPRECATED_NODE_VERSION: true | |
run: npm run test:e2e -w ${{ matrix.package }} |