fix: speed up CI #287
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 if there will be changes to | |
| # aws-lambda-java-runtime-interface-client package or its dependencies (core, serialization), | |
| # and it builds the package. | |
| name: PR to runtime-interface-client | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: [ '*' ] | |
| paths: | |
| - 'aws-lambda-java-runtime-interface-client/**' | |
| - 'aws-lambda-java-core/**' | |
| - 'aws-lambda-java-serialization/**' | |
| - '.github/workflows/runtime-interface-client_*.yml' | |
| permissions: | |
| contents: read | |
| jobs: | |
| smoke-test-arch: | |
| 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: 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: | |
| 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: 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 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| 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 |