Merge pull request #642 from aws/fabisev/codecov-both-archs #72
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 will be triggered on merge to the main branch if | |
| # aws-lambda-java-runtime-interface-client package was changed | |
| # | |
| # It will publish artifacts to CodeArtifact repository, specified by properties defined in GitHub repo secrets: | |
| # CODE_ARTIFACT_REPO_ACCOUNT, AWS_REGION, CODE_ARTIFACT_REPO_NAME, CODE_ARTIFACT_DOMAIN | |
| # and will assume role specified by AWS_ROLE | |
| # | |
| # Prerequisite setup: | |
| # https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services | |
| name: Publish artifact for aws-lambda-java-runtime-interface-client | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'aws-lambda-java-runtime-interface-client/**' | |
| - '.github/workflows/runtime-interface-client_*.yml' | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| 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 QEMU | |
| uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 | |
| with: | |
| install: true | |
| - name: Available buildx platforms | |
| run: echo ${{ steps.buildx.outputs.platforms }} | |
| - name: Build and install serialization dependency locally | |
| working-directory: ./aws-lambda-java-serialization | |
| run: mvn clean install | |
| - name: Test Runtime Interface Client xplatform build - Run 'build' target | |
| working-directory: ./aws-lambda-java-runtime-interface-client | |
| run: make build | |
| env: | |
| IS_JAVA_8: true | |
| - name: Issue AWS credentials | |
| if: env.ENABLE_SNAPSHOT != null | |
| env: | |
| ENABLE_SNAPSHOT: ${{ secrets.ENABLE_SNAPSHOT }} | |
| uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4 | |
| with: | |
| aws-region: ${{ secrets.AWS_REGION }} | |
| role-to-assume: ${{ secrets.AWS_ROLE }} | |
| role-session-name: GitHubActionsPublishPackage | |
| role-duration-seconds: 900 | |
| - name: Prepare codeartifact properties | |
| if: env.ENABLE_SNAPSHOT != null | |
| env: | |
| ENABLE_SNAPSHOT: ${{ secrets.ENABLE_SNAPSHOT }} | |
| working-directory: ./aws-lambda-java-runtime-interface-client/ric-dev-environment | |
| run: | | |
| cat <<EOF > codeartifact-properties.mk | |
| CODE_ARTIFACT_REPO_ACCOUNT=${{ secrets.AWS_ACCOUNT }} | |
| CODE_ARTIFACT_REPO_REGION=${{ env.AWS_REGION }} | |
| CODE_ARTIFACT_REPO_NAME=${{ secrets.CODE_ARTIFACT_REPO_NAME }} | |
| CODE_ARTIFACT_DOMAIN=${{ secrets.AWS_CODEARTIFACT_DOMAIN }} | |
| EOF | |
| - name: Publish | |
| if: env.ENABLE_SNAPSHOT != null | |
| working-directory: ./aws-lambda-java-runtime-interface-client | |
| env: | |
| ENABLE_SNAPSHOT: ${{ secrets.ENABLE_SNAPSHOT }} | |
| run: make publish | |
| # Coverage is measured on both native architectures (x86_64 and aarch64) so | |
| # the coverage recorded for a merge to main matches what the PR build recorded | |
| # (the union of both archs). Uploading a single x86_64 report here previously | |
| # made every merge commit look ~0.4% lower than its own PR base, failing the | |
| # codecov/project status on identical code. | |
| coverage: | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - arch: x86_64 | |
| runner: ubuntu-latest | |
| - arch: aarch64 | |
| runner: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runner }} | |
| name: "coverage (${{ 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: Build Runtime Interface Client - Run 'build-${{ matrix.arch }}' target | |
| working-directory: ./aws-lambda-java-runtime-interface-client | |
| run: make build-${{ matrix.arch }} | |
| env: | |
| IS_JAVA_8: true | |
| - 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 }} |