Skip to content

Commit 613a9ae

Browse files
authored
ci: switch e2e env in run-e2e-tests workflow (#4347)
1 parent 4c1bcc3 commit 613a9ae

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

.github/workflows/run-e2e-tests.yml

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
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.'
88
required: false
99
default: ''
1010

@@ -18,6 +18,7 @@ jobs:
1818
NODE_ENV: dev
1919
PR_NUMBER: ${{ inputs.prNumber }}
2020
GH_TOKEN: ${{ github.token }}
21+
environment: e2e-tests
2122
permissions:
2223
id-token: write # needed to interact with GitHub's OIDC Token endpoint.
2324
contents: read
@@ -39,40 +40,27 @@ jobs:
3940
steps:
4041
- name: Checkout Repo
4142
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"
5443
# Only if a PR Number was passed and the headSHA of the PR extracted,
5544
# we checkout the PR at that point in time
5645
- name: Checkout PR code
5746
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
6250
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
6351
with:
6452
node-version: '22'
6553
- 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
6755
with:
68-
nodeVersion: '22'
56+
node-version: '22'
6957
- name: Setup AWS credentials
7058
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
7159
with:
72-
role-to-assume: ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
60+
role-to-assume: ${{ secrets.E2E_IAM_ROLE_ARN }}
7361
aws-region: eu-west-1
7462
mask-aws-account-id: true
75-
- name: Run integration tests on utils
63+
- name: Run e2e ${{ matrix.package }}-${{ matrix.version }}-${{ matrix.arch }}
7664
env:
7765
RUNTIME: nodejs${{ matrix.version }}x
7866
CI: true

0 commit comments

Comments
 (0)