Skip to content

Commit 9610b52

Browse files
author
Fabiana Severin
committed
fix: run integ test on both architectures
1 parent 76ec4ed commit 9610b52

4 files changed

Lines changed: 64 additions & 6 deletions

File tree

.github/test-matrix.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"arch": [
3+
{
4+
"runner": "ubuntu-latest",
5+
"label": "x64",
6+
"sam_arch": "x86_64"
7+
},
8+
{
9+
"runner": "ubuntu-24.04-arm",
10+
"label": "arm64",
11+
"sam_arch": "arm64"
12+
}
13+
]
14+
}

.github/workflows/build-integration-test.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,26 @@ permissions:
2323
contents: read
2424

2525
jobs:
26-
build:
26+
load-matrix:
2727
runs-on: ubuntu-latest
28+
outputs:
29+
matrix: ${{ steps.set.outputs.matrix }}
30+
steps:
31+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
32+
33+
- name: Load test matrix
34+
id: set
35+
run: |
36+
MATRIX=$(jq -c '.' .github/test-matrix.json)
37+
echo "matrix=${MATRIX}" >> "$GITHUB_OUTPUT"
38+
39+
build:
40+
needs: load-matrix
41+
runs-on: ${{ matrix.arch.runner }}
42+
strategy:
43+
fail-fast: false
44+
matrix: ${{ fromJson(needs.load-matrix.outputs.matrix) }}
45+
name: "build (${{ matrix.arch.label }})"
2846
steps:
2947
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
3048

.github/workflows/run-integration-test.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,30 @@ on:
1717
- 'lambda-integration-tests/**'
1818

1919
jobs:
20+
load-matrix:
21+
runs-on: ubuntu-latest
22+
outputs:
23+
matrix: ${{ steps.set.outputs.matrix }}
24+
steps:
25+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
26+
27+
- name: Load test matrix
28+
id: set
29+
run: |
30+
MATRIX=$(jq -c '.' .github/test-matrix.json)
31+
echo "matrix=${MATRIX}" >> "$GITHUB_OUTPUT"
32+
2033
run-integration-tests:
21-
# Only run on the main repo, not forks
34+
needs: load-matrix
35+
# Only run on the main repo, not forks
2236
if: ${{ github.repository_owner == 'aws' }}
23-
runs-on: ubuntu-latest
37+
runs-on: ${{ matrix.arch.runner }}
38+
strategy:
39+
fail-fast: false
40+
matrix: ${{ fromJson(needs.load-matrix.outputs.matrix) }}
41+
name: "integration-test (${{ matrix.arch.label }})"
2442
concurrency:
25-
group: integration-test
43+
group: integration-test-${{ matrix.arch.label }}
2644
cancel-in-progress: false
2745
steps:
2846
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
@@ -72,12 +90,12 @@ jobs:
7290
AWS_REGION: ${{ secrets.AWS_REGION }}
7391
run: |
7492
cd lambda-integration-tests
75-
stackName="aws-lambda-java-log4j2-integ-test-$GITHUB_RUN_ID"
93+
stackName="aws-lambda-java-log4j2-integ-test-${{ matrix.arch.label }}-$GITHUB_RUN_ID"
7694
echo "STACK_NAME=$stackName" >> "$GITHUB_OUTPUT"
7795
echo "Stack name = $stackName"
7896
sam deploy \
7997
--stack-name "${stackName}" \
80-
--parameter-overrides "ParameterKey=LambdaRole,ParameterValue=${{ secrets.AWS_LAMBDA_ROLE }}" \
98+
--parameter-overrides "ParameterKey=LambdaRole,ParameterValue=${{ secrets.AWS_LAMBDA_ROLE }} ParameterKey=Architecture,ParameterValue=${{ matrix.arch.sam_arch }}" \
8199
--no-confirm-changeset \
82100
--no-progressbar \
83101
--resolve-s3 \

lambda-integration-tests/template.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Description: aws-lambda-java-log4j2 integration tests
55
Parameters:
66
LambdaRole:
77
Type: String
8+
Architecture:
9+
Type: String
10+
Default: x86_64
11+
AllowedValues:
12+
- x86_64
13+
- arm64
814

915
Globals:
1016
Function:
@@ -20,6 +26,8 @@ Resources:
2026
CodeUri: log4j2-test-function/
2127
Handler: integ.Log4j2TestHandler::handleRequest
2228
Runtime: java21
29+
Architectures:
30+
- !Ref Architecture
2331
Role: !Ref LambdaRole
2432
Environment:
2533
Variables:

0 commit comments

Comments
 (0)