-
Notifications
You must be signed in to change notification settings - Fork 153
82 lines (79 loc) · 2.82 KB
/
run-e2e-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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 }}
GH_TOKEN: ${{ github.token }}
permissions:
id-token: write # needed to interact with GitHub's OIDC Token endpoint.
contents: read
strategy:
max-parallel: 25
matrix:
package:
[
packages/idempotency,
packages/logger,
packages/metrics,
packages/parameters,
packages/tracer,
layers,
]
version: [18, 20, 22]
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 != '' }}
run: |
# Get the PR number from the input
pr_number=${{ inputs.prNumber }}
# Get the headSHA of the PR
head_sha=$(gh pr view $pr_number --json headRefOid -q '.headRefOid')
# Set the headSHA as an output variable
echo "headSHA=$head_sha" >> $GITHUB_OUTPUT
echo "headSHA=$head_sha"
# 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@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '22'
- name: Setup dependencies
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
with:
nodeVersion: '22'
- name: Setup AWS credentials
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
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
RUNNER_DEBUG: ${{ env.RUNNER_DEBUG }}
run: npm run test:e2e -w ${{ matrix.package }}