From 76e2639219ce0b750b5b455758f57f909eb7d9cf Mon Sep 17 00:00:00 2001 From: Maxime David Date: Wed, 18 Nov 2026 18:34:59 +0000 Subject: [PATCH 1/9] feat: integ test --- .github/workflows/integration-test.yml | 139 +++++++++++++++++++++++++ test/integration/Dockerfile | 4 + test/integration/app.js | 7 ++ test/integration/invoke.mjs | 55 ++++++++++ test/integration/package.json | 10 ++ 5 files changed, 215 insertions(+) create mode 100644 .github/workflows/integration-test.yml create mode 100644 test/integration/Dockerfile create mode 100644 test/integration/app.js create mode 100644 test/integration/invoke.mjs create mode 100644 test/integration/package.json diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml new file mode 100644 index 0000000..543b5d1 --- /dev/null +++ b/.github/workflows/integration-test.yml @@ -0,0 +1,139 @@ +# Integration test for the runtime image. +# +# For each architecture it pulls a published runtime image from ECR (the most recently pushed +# tag, since there is no 'latest' tag), layers a hello-world handler onto it, deploys it as a +# real Lambda container function with aws-actions/aws-lambda-deploy, invokes the function with +# the AWS SDK and asserts a 200 response, then deletes the function and the image it pushed. +# +# Manual trigger only: the workflow creates and deletes real AWS resources. Authentication is +# via GitHub OIDC into an IAM role created once with setup.md. +# +# Required repository configuration (see setup.md): +# secrets.AWS_INTEGRATION_ROLE_ARN the GitHub OIDC role this workflow assumes +# secrets.AWS_LAMBDA_EXEC_ROLE_ARN the Lambda function's execution role +# vars.AWS_REGION the region to deploy into +# vars.INTEG_ECR_REPOSITORY optional: ECR repo for the hello-world image +# (default: aws-lambda-nodejs-runtime-integ) +name: Integration test + +on: + workflow_dispatch: + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +env: + # The repository the build-image workflow publishes runtime images to, tagged -. + SOURCE_ECR_REPOSITORY: aws-lambda-nodejs-runtime + # The repository this workflow pushes the derived hello-world image to. + INTEG_ECR_REPOSITORY: ${{ vars.INTEG_ECR_REPOSITORY || 'aws-lambda-nodejs-runtime-integ' }} + +jobs: + integration-test: + name: integration-test-${{ matrix.arch }} + runs-on: ubuntu-latest + timeout-minutes: 30 + strategy: + # One architecture's failure should not cancel the other. + fail-fast: false + matrix: + include: + - arch: amd64 + lambda_arch: x86_64 + - arch: arm64 + lambda_arch: arm64 + # id-token lets configure-aws-credentials request the OIDC token the role trusts. + permissions: + contents: read + id-token: write + env: + ARCH: ${{ matrix.arch }} + FUNCTION_NAME: nodejs-runtime-integ-${{ matrix.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + IMAGE_TAG: integ-${{ matrix.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Configure AWS credentials (OIDC) + uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0 + with: + role-to-assume: ${{ secrets.AWS_INTEGRATION_ROLE_ARN }} + aws-region: ${{ vars.AWS_REGION }} + + - name: Log in to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@03f1aad4c6c7ffd436567f42f9384779290529bd # v2.1.7 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 + + - name: Resolve the latest runtime image for ${{ matrix.arch }} + id: resolve + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + run: | + set -euo pipefail + # Images are published as - with no 'latest' tag, so take the most + # recently pushed tag whose suffix matches this architecture. + tag=$(aws ecr describe-images --repository-name "$SOURCE_ECR_REPOSITORY" \ + --query "reverse(sort_by(imageDetails[?imageTags], &imagePushedAt))[].imageTags[]" \ + --output text | tr '\t' '\n' | grep -E -- "-${ARCH}$" | head -n1 || true) + if [ -z "$tag" ]; then + echo "no image tagged '*-${ARCH}' found in ${SOURCE_ECR_REPOSITORY}" >&2 + exit 1 + fi + echo "runtime image tag: $tag" + echo "runtime_image=${ECR_REGISTRY}/${SOURCE_ECR_REPOSITORY}:${tag}" >> "$GITHUB_OUTPUT" + + - name: Build and push the hello-world image + id: build + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + RUNTIME_IMAGE: ${{ steps.resolve.outputs.runtime_image }} + run: | + set -euo pipefail + image="${ECR_REGISTRY}/${INTEG_ECR_REPOSITORY}:${IMAGE_TAG}" + # Single-platform image with no attestations: Lambda requires a Docker media-type + # manifest, not an OCI image index. + docker buildx build \ + --platform "linux/${ARCH}" \ + --provenance=false --sbom=false \ + --build-arg "RUNTIME_IMAGE=${RUNTIME_IMAGE}" \ + --tag "$image" \ + --push \ + test/integration + echo "image_uri=${image}" >> "$GITHUB_OUTPUT" + + - name: Deploy the Lambda function + uses: aws-actions/aws-lambda-deploy@29ea35c124579506cf0475e20df36198eb670d89 # v1.1.0 + with: + function-name: ${{ env.FUNCTION_NAME }} + package-type: Image + image-uri: ${{ steps.build.outputs.image_uri }} + role: ${{ secrets.AWS_LAMBDA_EXEC_ROLE_ARN }} + architectures: ${{ matrix.lambda_arch }} + memory-size: 256 + timeout: 30 + + - name: Invoke the function and assert 200 + working-directory: test/integration + run: | + set -euo pipefail + npm install --no-audit --no-fund + node invoke.mjs "$FUNCTION_NAME" + + - name: Destroy the Lambda function + if: always() + run: | + aws lambda delete-function --function-name "$FUNCTION_NAME" || true + + - name: Delete the pushed ECR image + if: always() + run: | + aws ecr batch-delete-image \ + --repository-name "$INTEG_ECR_REPOSITORY" \ + --image-ids imageTag="$IMAGE_TAG" || true diff --git a/test/integration/Dockerfile b/test/integration/Dockerfile new file mode 100644 index 0000000..69cc796 --- /dev/null +++ b/test/integration/Dockerfile @@ -0,0 +1,4 @@ +ARG RUNTIME_IMAGE +FROM ${RUNTIME_IMAGE} +COPY app.js /var/task/ +CMD ["app.handler"] diff --git a/test/integration/app.js b/test/integration/app.js new file mode 100644 index 0000000..cca7180 --- /dev/null +++ b/test/integration/app.js @@ -0,0 +1,7 @@ +exports.handler = async (event) => { + console.log("integration-test handler invoked:", JSON.stringify(event)); + return { + statusCode: 200, + body: JSON.stringify({ message: "hello world", node: process.version }), + }; +}; diff --git a/test/integration/invoke.mjs b/test/integration/invoke.mjs new file mode 100644 index 0000000..2a2903e --- /dev/null +++ b/test/integration/invoke.mjs @@ -0,0 +1,55 @@ +import { + LambdaClient, + InvokeCommand, + waitUntilFunctionActiveV2, +} from "@aws-sdk/client-lambda"; + +const functionName = process.argv[2]; +if (!functionName) { + console.error("usage: node invoke.mjs FUNCTION_NAME"); + process.exit(2); +} + +const client = new LambdaClient({}); + +console.log(`waiting for ${functionName} to become Active...`); +await waitUntilFunctionActiveV2({ client, maxWaitTime: 300 }, { FunctionName: functionName }); + +console.log(`invoking ${functionName}...`); +const response = await client.send( + new InvokeCommand({ + FunctionName: functionName, + Payload: Buffer.from(JSON.stringify({ source: "integration-test" })), + }), +); + +const payloadText = response.Payload ? Buffer.from(response.Payload).toString("utf8") : ""; +console.log(`StatusCode: ${response.StatusCode}`); +console.log(`FunctionError: ${response.FunctionError ?? "(none)"}`); +console.log(`Payload: ${payloadText}`); + +const failures = []; +if (response.StatusCode !== 200) { + failures.push(`expected Invoke StatusCode 200, got ${response.StatusCode}`); +} +if (response.FunctionError) { + failures.push(`function reported an error: ${response.FunctionError}`); +} + +let payload; +try { + payload = JSON.parse(payloadText); +} catch { + failures.push(`response payload was not JSON: ${payloadText}`); +} +if (payload && payload.statusCode !== 200) { + failures.push(`expected handler payload statusCode 200, got ${JSON.stringify(payload.statusCode)}`); +} + +if (failures.length) { + console.error("FAIL"); + for (const failure of failures) console.error(` - ${failure}`); + process.exit(1); +} + +console.log("PASS: invocation returned 200"); diff --git a/test/integration/package.json b/test/integration/package.json new file mode 100644 index 0000000..7a26dff --- /dev/null +++ b/test/integration/package.json @@ -0,0 +1,10 @@ +{ + "name": "nodejs-runtime-integration-test", + "version": "1.0.0", + "private": true, + "type": "module", + "description": "SDK invoke client for the runtime image integration test", + "dependencies": { + "@aws-sdk/client-lambda": "^3.0.0" + } +} From 3b475a99c575b60310c6b7f7024976349a6feb29 Mon Sep 17 00:00:00 2001 From: Maxime David Date: Wed, 18 Nov 2026 18:39:47 +0000 Subject: [PATCH 2/9] feat: trigger --- .github/workflows/integration-test.yml | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 543b5d1..41a84db 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -1,23 +1,8 @@ -# Integration test for the runtime image. -# -# For each architecture it pulls a published runtime image from ECR (the most recently pushed -# tag, since there is no 'latest' tag), layers a hello-world handler onto it, deploys it as a -# real Lambda container function with aws-actions/aws-lambda-deploy, invokes the function with -# the AWS SDK and asserts a 200 response, then deletes the function and the image it pushed. -# -# Manual trigger only: the workflow creates and deletes real AWS resources. Authentication is -# via GitHub OIDC into an IAM role created once with setup.md. -# -# Required repository configuration (see setup.md): -# secrets.AWS_INTEGRATION_ROLE_ARN the GitHub OIDC role this workflow assumes -# secrets.AWS_LAMBDA_EXEC_ROLE_ARN the Lambda function's execution role -# vars.AWS_REGION the region to deploy into -# vars.INTEG_ECR_REPOSITORY optional: ECR repo for the hello-world image -# (default: aws-lambda-nodejs-runtime-integ) name: Integration test on: workflow_dispatch: + pull_request: permissions: {} @@ -26,10 +11,8 @@ concurrency: cancel-in-progress: false env: - # The repository the build-image workflow publishes runtime images to, tagged -. SOURCE_ECR_REPOSITORY: aws-lambda-nodejs-runtime - # The repository this workflow pushes the derived hello-world image to. - INTEG_ECR_REPOSITORY: ${{ vars.INTEG_ECR_REPOSITORY || 'aws-lambda-nodejs-runtime-integ' }} + INTEG_ECR_REPOSITORY: ${{ vars.INTEG_ECR_REPOSITORY }} jobs: integration-test: @@ -37,7 +20,6 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 strategy: - # One architecture's failure should not cancel the other. fail-fast: false matrix: include: @@ -45,7 +27,7 @@ jobs: lambda_arch: x86_64 - arch: arm64 lambda_arch: arm64 - # id-token lets configure-aws-credentials request the OIDC token the role trusts. + permissions: contents: read id-token: write From db073646e295e5261dd14ea8c4eca53e8022e868 Mon Sep 17 00:00:00 2001 From: Maxime David Date: Wed, 18 Nov 2026 20:03:49 +0000 Subject: [PATCH 3/9] feat: secret --- .github/workflows/integration-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 41a84db..f01f667 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -44,7 +44,7 @@ jobs: uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0 with: role-to-assume: ${{ secrets.AWS_INTEGRATION_ROLE_ARN }} - aws-region: ${{ vars.AWS_REGION }} + aws-region: ${{ secrets.AWS_REGION }} - name: Log in to Amazon ECR id: login-ecr From 52419bc5b464d4bc1eced3d8ca62841a56b4e0ea Mon Sep 17 00:00:00 2001 From: Maxime David Date: Wed, 18 Nov 2026 21:03:24 +0000 Subject: [PATCH 4/9] fix: use secret instead of vars --- .github/workflows/integration-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index f01f667..5b95bd4 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -12,7 +12,7 @@ concurrency: env: SOURCE_ECR_REPOSITORY: aws-lambda-nodejs-runtime - INTEG_ECR_REPOSITORY: ${{ vars.INTEG_ECR_REPOSITORY }} + INTEG_ECR_REPOSITORY: ${{ secrets.INTEG_ECR_REPOSITORY }} jobs: integration-test: From adf37432f8f8ae9eacd87c6a4b4a11fe2ddef849 Mon Sep 17 00:00:00 2001 From: Maxime David Date: Wed, 18 Nov 2026 21:44:11 +0000 Subject: [PATCH 5/9] fix: full workflow --- .github/workflows/build-image.yml | 71 ++++++++++++++- .github/workflows/integration-test.yml | 121 ------------------------- 2 files changed, 70 insertions(+), 122 deletions(-) delete mode 100644 .github/workflows/integration-test.yml diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 16dca1c..19b8ce4 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -40,8 +40,10 @@ jobs: include: - arch: arm64 project: project-aws-aws-lambda-nodejs-runtime-arm64 + lambda_arch: arm64 - arch: amd64 project: project-aws-aws-lambda-nodejs-runtime-x86 + lambda_arch: x86_64 runs-on: - codebuild-${{ matrix.project }}-${{ github.run_id }}-${{ github.run_attempt }} - instance-size:2xlarge @@ -55,6 +57,8 @@ jobs: BUILDKIT_PROGRESS: plain ARCH: ${{ matrix.arch }} IMAGE: lambda-runtime/image:nodejs26.x-mainline-${{ matrix.arch }} + FUNCTION_NAME: nodejs-runtime-integ-${{ matrix.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + IMAGE_TAG: integ-${{ matrix.arch }}-${{ github.run_id }}-${{ github.run_attempt }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: @@ -113,7 +117,72 @@ jobs: - name: Security-test the image run: node test/run.mjs "$IMAGE" "linux/$ARCH" test/security-cases.json - - name: Configure AWS credentials (OIDC) + - name: Configure AWS credentials (integration test) + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) + uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0 + with: + role-to-assume: ${{ secrets.AWS_INTEGRATION_ROLE_ARN }} + aws-region: ${{ secrets.AWS_REGION }} + + - name: Log in to Amazon ECR (integration test) + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) + id: login-ecr-integ + uses: aws-actions/amazon-ecr-login@03f1aad4c6c7ffd436567f42f9384779290529bd # v2.1.7 + + - name: Build and push the hello-world test image + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) + id: integ-build + env: + ECR_REGISTRY: ${{ steps.login-ecr-integ.outputs.registry }} + INTEG_ECR_REPOSITORY: ${{ secrets.INTEG_ECR_REPOSITORY }} + run: | + set -euo pipefail + image="${ECR_REGISTRY}/${INTEG_ECR_REPOSITORY}:${IMAGE_TAG}" + # Layer the hello-world handler onto the image just built locally. Single-platform and + # no attestations: Lambda needs a Docker media-type manifest, not an OCI image index. + docker buildx build \ + --platform "linux/${ARCH}" \ + --provenance=false --sbom=false \ + --build-arg "RUNTIME_IMAGE=${IMAGE}" \ + --tag "$image" \ + --push \ + test/integration + echo "image_uri=${image}" >> "$GITHUB_OUTPUT" + + - name: Deploy the test Lambda function + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) + uses: aws-actions/aws-lambda-deploy@29ea35c124579506cf0475e20df36198eb670d89 # v1.1.0 + with: + function-name: ${{ env.FUNCTION_NAME }} + package-type: Image + image-uri: ${{ steps.integ-build.outputs.image_uri }} + role: ${{ secrets.AWS_LAMBDA_EXEC_ROLE_ARN }} + architectures: ${{ matrix.lambda_arch }} + memory-size: 256 + timeout: 30 + + - name: Invoke the test function and assert 200 + if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) + working-directory: test/integration + run: | + set -euo pipefail + npm install --no-audit --no-fund + node invoke.mjs "$FUNCTION_NAME" + + - name: Destroy the test Lambda function + if: always() && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) + run: aws lambda delete-function --function-name "$FUNCTION_NAME" || true + + - name: Delete the pushed test image + if: always() && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) + env: + INTEG_ECR_REPOSITORY: ${{ secrets.INTEG_ECR_REPOSITORY }} + run: | + aws ecr batch-delete-image \ + --repository-name "$INTEG_ECR_REPOSITORY" \ + --image-ids imageTag="$IMAGE_TAG" || true + + - name: Configure AWS credentials (source push) if: github.event_name == 'push' uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0 with: diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml deleted file mode 100644 index 5b95bd4..0000000 --- a/.github/workflows/integration-test.yml +++ /dev/null @@ -1,121 +0,0 @@ -name: Integration test - -on: - workflow_dispatch: - pull_request: - -permissions: {} - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: false - -env: - SOURCE_ECR_REPOSITORY: aws-lambda-nodejs-runtime - INTEG_ECR_REPOSITORY: ${{ secrets.INTEG_ECR_REPOSITORY }} - -jobs: - integration-test: - name: integration-test-${{ matrix.arch }} - runs-on: ubuntu-latest - timeout-minutes: 30 - strategy: - fail-fast: false - matrix: - include: - - arch: amd64 - lambda_arch: x86_64 - - arch: arm64 - lambda_arch: arm64 - - permissions: - contents: read - id-token: write - env: - ARCH: ${{ matrix.arch }} - FUNCTION_NAME: nodejs-runtime-integ-${{ matrix.arch }}-${{ github.run_id }}-${{ github.run_attempt }} - IMAGE_TAG: integ-${{ matrix.arch }}-${{ github.run_id }}-${{ github.run_attempt }} - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - with: - persist-credentials: false - - - name: Configure AWS credentials (OIDC) - uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0 - with: - role-to-assume: ${{ secrets.AWS_INTEGRATION_ROLE_ARN }} - aws-region: ${{ secrets.AWS_REGION }} - - - name: Log in to Amazon ECR - id: login-ecr - uses: aws-actions/amazon-ecr-login@03f1aad4c6c7ffd436567f42f9384779290529bd # v2.1.7 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 - - - name: Resolve the latest runtime image for ${{ matrix.arch }} - id: resolve - env: - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - run: | - set -euo pipefail - # Images are published as - with no 'latest' tag, so take the most - # recently pushed tag whose suffix matches this architecture. - tag=$(aws ecr describe-images --repository-name "$SOURCE_ECR_REPOSITORY" \ - --query "reverse(sort_by(imageDetails[?imageTags], &imagePushedAt))[].imageTags[]" \ - --output text | tr '\t' '\n' | grep -E -- "-${ARCH}$" | head -n1 || true) - if [ -z "$tag" ]; then - echo "no image tagged '*-${ARCH}' found in ${SOURCE_ECR_REPOSITORY}" >&2 - exit 1 - fi - echo "runtime image tag: $tag" - echo "runtime_image=${ECR_REGISTRY}/${SOURCE_ECR_REPOSITORY}:${tag}" >> "$GITHUB_OUTPUT" - - - name: Build and push the hello-world image - id: build - env: - ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} - RUNTIME_IMAGE: ${{ steps.resolve.outputs.runtime_image }} - run: | - set -euo pipefail - image="${ECR_REGISTRY}/${INTEG_ECR_REPOSITORY}:${IMAGE_TAG}" - # Single-platform image with no attestations: Lambda requires a Docker media-type - # manifest, not an OCI image index. - docker buildx build \ - --platform "linux/${ARCH}" \ - --provenance=false --sbom=false \ - --build-arg "RUNTIME_IMAGE=${RUNTIME_IMAGE}" \ - --tag "$image" \ - --push \ - test/integration - echo "image_uri=${image}" >> "$GITHUB_OUTPUT" - - - name: Deploy the Lambda function - uses: aws-actions/aws-lambda-deploy@29ea35c124579506cf0475e20df36198eb670d89 # v1.1.0 - with: - function-name: ${{ env.FUNCTION_NAME }} - package-type: Image - image-uri: ${{ steps.build.outputs.image_uri }} - role: ${{ secrets.AWS_LAMBDA_EXEC_ROLE_ARN }} - architectures: ${{ matrix.lambda_arch }} - memory-size: 256 - timeout: 30 - - - name: Invoke the function and assert 200 - working-directory: test/integration - run: | - set -euo pipefail - npm install --no-audit --no-fund - node invoke.mjs "$FUNCTION_NAME" - - - name: Destroy the Lambda function - if: always() - run: | - aws lambda delete-function --function-name "$FUNCTION_NAME" || true - - - name: Delete the pushed ECR image - if: always() - run: | - aws ecr batch-delete-image \ - --repository-name "$INTEG_ECR_REPOSITORY" \ - --image-ids imageTag="$IMAGE_TAG" || true From 83c4c1275f8814737748a7d977f3fc74cbdb623a Mon Sep 17 00:00:00 2001 From: Maxime David Date: Wed, 18 Nov 2026 22:00:40 +0000 Subject: [PATCH 6/9] fix: add new branch --- .github/workflows/build-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 19b8ce4..09ebfa8 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -15,9 +15,9 @@ name: Build runtime image on: push: - branches: [main] + branches: [main, svozza/runtime-image] pull_request: - branches: [main] + branches: [main, svozza/runtime-image] workflow_dispatch: permissions: {} From 2444becf04deb5f34c84b98214cfa5d7a07bb355 Mon Sep 17 00:00:00 2001 From: Maxime David Date: Thu, 19 Nov 2026 02:46:33 +0000 Subject: [PATCH 7/9] fix: use npmrc --- .github/workflows/build-image.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 09ebfa8..dafb2d2 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -127,7 +127,7 @@ jobs: - name: Log in to Amazon ECR (integration test) if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) id: login-ecr-integ - uses: aws-actions/amazon-ecr-login@03f1aad4c6c7ffd436567f42f9384779290529bd # v2.1.7 + uses: aws-actions/amazon-ecr-login@7290e214a610b32bc0eef81748948b6d466a8783 # v2.2.0 - name: Build and push the hello-world test image if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) @@ -151,7 +151,7 @@ jobs: - name: Deploy the test Lambda function if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) - uses: aws-actions/aws-lambda-deploy@29ea35c124579506cf0475e20df36198eb670d89 # v1.1.0 + uses: aws-actions/aws-lambda-deploy@d496277188b89f0be02d7a2216fc912c0427702a # v1.1.2 with: function-name: ${{ env.FUNCTION_NAME }} package-type: Image @@ -166,7 +166,11 @@ jobs: working-directory: test/integration run: | set -euo pipefail - npm install --no-audit --no-fund + if [ -n "${NPMRC:-}" ]; then + npm install --userconfig "$NPMRC" + else + npm install + fi node invoke.mjs "$FUNCTION_NAME" - name: Destroy the test Lambda function @@ -192,7 +196,7 @@ jobs: - name: Log in to Amazon ECR if: github.event_name == 'push' id: login-ecr - uses: aws-actions/amazon-ecr-login@03f1aad4c6c7ffd436567f42f9384779290529bd # v2.1.7 + uses: aws-actions/amazon-ecr-login@7290e214a610b32bc0eef81748948b6d466a8783 # v2.2.0 - name: Push the image if: github.event_name == 'push' From ecf44c1840dab0955814573fc8caa49622120f4a Mon Sep 17 00:00:00 2001 From: Maxime David Date: Thu, 19 Nov 2026 15:56:21 +0000 Subject: [PATCH 8/9] feat: simplify integration testing --- .github/workflows/build-image.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index dafb2d2..f2b8e0c 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -57,7 +57,7 @@ jobs: BUILDKIT_PROGRESS: plain ARCH: ${{ matrix.arch }} IMAGE: lambda-runtime/image:nodejs26.x-mainline-${{ matrix.arch }} - FUNCTION_NAME: nodejs-runtime-integ-${{ matrix.arch }}-${{ github.run_id }}-${{ github.run_attempt }} + FUNCTION_NAME: nodejs-runtime-integ-${{ matrix.arch }} IMAGE_TAG: integ-${{ matrix.arch }}-${{ github.run_id }}-${{ github.run_attempt }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 @@ -118,19 +118,19 @@ jobs: run: node test/run.mjs "$IMAGE" "linux/$ARCH" test/security-cases.json - name: Configure AWS credentials (integration test) - if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) + if: github.event_name == 'push' uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0 with: role-to-assume: ${{ secrets.AWS_INTEGRATION_ROLE_ARN }} aws-region: ${{ secrets.AWS_REGION }} - name: Log in to Amazon ECR (integration test) - if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) + if: github.event_name == 'push' id: login-ecr-integ uses: aws-actions/amazon-ecr-login@7290e214a610b32bc0eef81748948b6d466a8783 # v2.2.0 - name: Build and push the hello-world test image - if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) + if: github.event_name == 'push' id: integ-build env: ECR_REGISTRY: ${{ steps.login-ecr-integ.outputs.registry }} @@ -150,7 +150,7 @@ jobs: echo "image_uri=${image}" >> "$GITHUB_OUTPUT" - name: Deploy the test Lambda function - if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) + if: github.event_name == 'push' uses: aws-actions/aws-lambda-deploy@d496277188b89f0be02d7a2216fc912c0427702a # v1.1.2 with: function-name: ${{ env.FUNCTION_NAME }} @@ -162,7 +162,7 @@ jobs: timeout: 30 - name: Invoke the test function and assert 200 - if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) + if: github.event_name == 'push' working-directory: test/integration run: | set -euo pipefail @@ -174,11 +174,11 @@ jobs: node invoke.mjs "$FUNCTION_NAME" - name: Destroy the test Lambda function - if: always() && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) + if: always() && github.event_name == 'push' run: aws lambda delete-function --function-name "$FUNCTION_NAME" || true - name: Delete the pushed test image - if: always() && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) + if: always() && github.event_name == 'push' env: INTEG_ECR_REPOSITORY: ${{ secrets.INTEG_ECR_REPOSITORY }} run: | From 8a8a3ba207733552da23e70f154e81fffce946de Mon Sep 17 00:00:00 2001 From: Maxime David Date: Thu, 19 Nov 2026 16:22:19 +0000 Subject: [PATCH 9/9] fix: branch trigger --- .github/workflows/build-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index f2b8e0c..af9adb4 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -15,9 +15,9 @@ name: Build runtime image on: push: - branches: [main, svozza/runtime-image] + branches: [main] pull_request: - branches: [main, svozza/runtime-image] + branches: [main] workflow_dispatch: permissions: {}