Repository navigation
chore: proposal #376
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow builds and tests the aws-lambda-java-runtime-interface-client package. | |
| # It runs on every pull request (no path filter) so that the smoke-test and | |
| # integration-test required status checks always report a result and never get | |
| # stuck "pending" on PRs that don't touch the RIC/core/serialization paths. | |
| name: PR to runtime-interface-client | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: [ '*' ] | |
| permissions: | |
| contents: read | |
| jobs: | |
| smoke-test-arch: | |
| permissions: | |
| id-token: write # ECR pull-through login; forks don't get a token | |
| contents: read | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - arch: x86_64 | |
| runner: ubuntu-latest | |
| - arch: aarch64 | |
| runner: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runner }} | |
| name: "smoke-test (${{ matrix.arch }})" | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Set up JDK 1.8 | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 | |
| with: | |
| java-version: 8 | |
| distribution: corretto | |
| cache: maven | |
| - name: Build and install core dependency locally | |
| working-directory: ./aws-lambda-java-core | |
| run: mvn clean install | |
| - name: Build and install serialization dependency locally | |
| working-directory: ./aws-lambda-java-serialization | |
| run: mvn clean install | |
| - name: Log in to the ECR pull-through cache | |
| uses: ./.github/actions/ecr-pull-through-login | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_ECR_PULL_THROUGH }} | |
| aws-region: ${{ vars.AWS_REGION_MAVEN_RELEASE }} | |
| aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }} | |
| - name: Runtime Interface Client smoke tests - Run 'pr-${{ matrix.arch }}' target | |
| working-directory: ./aws-lambda-java-runtime-interface-client | |
| run: make pr-${{ matrix.arch }} | |
| env: | |
| IS_JAVA_8: true | |
| build-arch: | |
| permissions: | |
| id-token: write # ECR pull-through login; forks don't get a token | |
| contents: read | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - arch: x86_64 | |
| runner: ubuntu-latest | |
| - arch: aarch64 | |
| runner: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runner }} | |
| name: "build (${{ matrix.arch }})" | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Set up JDK 1.8 | |
| uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 | |
| with: | |
| java-version: 8 | |
| distribution: corretto | |
| cache: maven | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 | |
| with: | |
| install: true | |
| - name: Build and install core dependency locally | |
| working-directory: ./aws-lambda-java-core | |
| run: mvn clean install | |
| - name: Build and install serialization dependency locally | |
| working-directory: ./aws-lambda-java-serialization | |
| run: mvn clean install | |
| - name: Log in to the ECR pull-through cache | |
| uses: ./.github/actions/ecr-pull-through-login | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_ECR_PULL_THROUGH }} | |
| aws-region: ${{ vars.AWS_REGION_MAVEN_RELEASE }} | |
| aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }} | |
| - name: Test Runtime Interface Client build - Run 'build-${{ matrix.arch }}' target | |
| working-directory: ./aws-lambda-java-runtime-interface-client | |
| run: make build-${{ matrix.arch }} | |
| env: | |
| IS_JAVA_8: true | |
| - name: Save the built jar | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: aws-lambda-java-runtime-interface-client-${{ matrix.arch }} | |
| path: ./aws-lambda-java-runtime-interface-client/target/aws-lambda-java-runtime-interface-client-*.jar | |
| - name: Upload coverage to Codecov | |
| if: env.CODECOV_TOKEN != null | |
| uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5 | |
| with: | |
| files: ./aws-lambda-java-runtime-interface-client/target/site/jacoco/jacoco.xml | |
| flags: ${{ matrix.arch }} | |
| disable_search: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| integration-test-matrix: | |
| permissions: | |
| id-token: write # ECR pull-through login; forks don't get a token | |
| contents: read | |
| runs-on: ${{ matrix.arch.runner }} | |
| strategy: | |
| # Run every OS/arch combination to completion so one failure doesn't mask the others. | |
| fail-fast: false | |
| # Fork PRs get no OIDC token for the ECR pull-through cache, so their shards | |
| # pull anonymously from public.ecr.aws, and shards started together trip | |
| # its rate limit (429). Cap how many run at once. | |
| max-parallel: 4 | |
| matrix: | |
| buildspec: | |
| - buildspec.os.alpine.yml | |
| - buildspec.os.amazoncorretto.yml | |
| - buildspec.os.amazonlinux.1.yml | |
| - buildspec.os.amazonlinux.2.yml | |
| - buildspec.os.debian.yml | |
| - buildspec.os.ubuntu.yml | |
| arch: | |
| - label: x64 | |
| runner: ubuntu-latest | |
| platform: linux/amd64 | |
| - label: arm64 | |
| runner: ubuntu-24.04-arm | |
| platform: linux/arm64/v8 | |
| exclude: | |
| # Amazon Linux 1 was never published for ARM64 (x86_64 only), so | |
| # public.ecr.aws/amazonlinux/amazonlinux:1 has no arm64 manifest. | |
| - buildspec: buildspec.os.amazonlinux.1.yml | |
| arch: | |
| label: arm64 | |
| runner: ubuntu-24.04-arm | |
| platform: linux/arm64/v8 | |
| name: "integration-test (${{ matrix.buildspec }} / ${{ matrix.arch.label }})" | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 | |
| with: | |
| install: true | |
| - name: Log in to the ECR pull-through cache | |
| uses: ./.github/actions/ecr-pull-through-login | |
| with: | |
| role-to-assume: ${{ secrets.AWS_ROLE_ECR_PULL_THROUGH }} | |
| aws-region: ${{ vars.AWS_REGION_MAVEN_RELEASE }} | |
| aws-account-id: ${{ secrets.AWS_ACCOUNT_ID }} | |
| - name: Run OS integration test - 'test-integ' target | |
| working-directory: ./aws-lambda-java-runtime-interface-client | |
| run: make test-integ BUILDSPEC=test/integration/codebuild/${{ matrix.buildspec }} | |
| env: | |
| PLATFORM_FILTER: ${{ matrix.arch.platform }} | |
| integration-test: | |
| needs: integration-test-matrix | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check integration-test results | |
| run: | | |
| if [ "${{ needs.integration-test-matrix.result }}" != "success" ]; then | |
| echo "Integration tests failed on one or more OS/arch combinations" | |
| exit 1 | |
| fi | |
| smoke-test: | |
| needs: smoke-test-arch | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check smoke-test results | |
| run: | | |
| if [ "${{ needs.smoke-test-arch.result }}" != "success" ]; then | |
| echo "Smoke tests failed on one or more architectures" | |
| exit 1 | |
| fi | |
| build: | |
| needs: build-arch | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check build results | |
| run: | | |
| if [ "${{ needs.build-arch.result }}" != "success" ]; then | |
| echo "Build failed on one or more architectures" | |
| exit 1 | |
| fi |