4
4
workflow_dispatch :
5
5
inputs :
6
6
prNumber :
7
- description : ' ( Optional) PR Number. If you specify a value the value of the branch field will be ignored.'
7
+ description : ' Optional PR number to checkout useful to run e2e tests on forks. When specified the branch field will be ignored.'
8
8
required : false
9
9
default : ' '
10
10
18
18
NODE_ENV : dev
19
19
PR_NUMBER : ${{ inputs.prNumber }}
20
20
GH_TOKEN : ${{ github.token }}
21
+ environment : e2e-tests
21
22
permissions :
22
23
id-token : write # needed to interact with GitHub's OIDC Token endpoint.
23
24
contents : read
@@ -39,40 +40,27 @@ jobs:
39
40
steps :
40
41
- name : Checkout Repo
41
42
uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
42
- # If we pass a PR Number when triggering the workflow we will retrieve the PR info and get its headSHA
43
- - name : Extract PR details
44
- id : extract_PR_details
45
- if : ${{ inputs.prNumber != '' }}
46
- run : |
47
- # Get the PR number from the input
48
- pr_number=${{ inputs.prNumber }}
49
- # Get the headSHA of the PR
50
- head_sha=$(gh pr view $pr_number --json headRefOid -q '.headRefOid')
51
- # Set the headSHA as an output variable
52
- echo "headSHA=$head_sha" >> $GITHUB_OUTPUT
53
- echo "headSHA=$head_sha"
54
43
# Only if a PR Number was passed and the headSHA of the PR extracted,
55
44
# we checkout the PR at that point in time
56
45
- name : Checkout PR code
57
46
if : ${{ inputs.prNumber != '' }}
58
- uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
59
- with :
60
- ref : ${{ steps.extract_PR_details.outputs.headSHA }}
61
- - name : Setup NodeJS
47
+ run : |
48
+ gh pr checkout ${{ inputs.prNumber }}
49
+ - name : Setup Node.js
62
50
uses : actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
63
51
with :
64
52
node-version : ' 22'
65
53
- name : Setup dependencies
66
- uses : aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
54
+ uses : aws-powertools/actions/.github/actions/cached-node-modules@3b5b8e2e58b7af07994be982e83584a94e8c76c5 # v1.5.0
67
55
with :
68
- nodeVersion : ' 22'
56
+ node-version : ' 22'
69
57
- name : Setup AWS credentials
70
58
uses : aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
71
59
with :
72
- role-to-assume : ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
60
+ role-to-assume : ${{ secrets.E2E_IAM_ROLE_ARN }}
73
61
aws-region : eu-west-1
74
62
mask-aws-account-id : true
75
- - name : Run integration tests on utils
63
+ - name : Run e2e ${{ matrix.package }}-${{ matrix.version }}-${{ matrix.arch }}
76
64
env :
77
65
RUNTIME : nodejs${{ matrix.version }}x
78
66
CI : true
0 commit comments