misc: refactor artifact size metrics #683
Workflow file for this run
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
| name: CI | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| PACKAGE_NAME: aws-crt-kotlin | |
| RUN: ${{ github.run_id }}-${{ github.run_number }} | |
| # generated dockcross scripts default to `podman` when installed which | |
| # has issues when building with docker then executing via dockcross script which | |
| # picks up `podman` instead. | |
| OCI_EXE: docker | |
| permissions: { } | |
| jobs: | |
| jvm: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # we build with a specific JDK version but source/target compatibility should ensure the jar is usable by | |
| # the target versions we want to support | |
| java-version: | |
| - 8 | |
| - 11 | |
| - 17 | |
| - 21 | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - name: Configure JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'corretto' | |
| java-version: 17 | |
| cache: 'gradle' | |
| - name: Setup build environment | |
| uses: ./.github/actions/setup-build | |
| - name: Test with ${{ matrix.java-version }} | |
| shell: bash | |
| run: | | |
| ./gradlew jvmApiCheck | |
| ./gradlew -Ptest.java.version=${{ matrix.java-version }} jvmTest --stacktrace | |
| - name: Save Test Reports | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-reports-jvm-${{ matrix.java-version }} | |
| path: '**/build/reports' | |
| # macos-14 build and test for targets: jvm, macosArm64, iosSimulatorArm64, watchosSimulatorArm65, tvosSimulatorArm64 | |
| # macos-13 build and test for targets: jvm, macosX64, iosX64, tvosX64, watchosX64 | |
| macos: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-14, macos-13] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup build environment | |
| uses: ./.github/actions/setup-build | |
| - name: Build and Test ${{ env.PACKAGE_NAME }} | |
| run: | | |
| if [ "${{ matrix.os }}" = "macos-13" ]; then | |
| ./gradlew build -PiosSimulatorDevice="iPhone 15" | |
| else | |
| ./gradlew build | |
| fi | |
| - name: Save Test Reports | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-reports-macos-${{ matrix.os }} | |
| path: '**/build/reports' | |
| # build and test for targets: jvm, linuxX64 | |
| # cross compile for: linuxX64, linuxArm64 | |
| linux: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup build environment | |
| uses: ./.github/actions/setup-build | |
| - name: Configure Docker Images | |
| run: | | |
| ./docker-images/build-images.sh linux-x64 linux-arm64 | |
| - name: Build and Test ${{ env.PACKAGE_NAME }} | |
| run: | | |
| ./gradlew build | |
| - name: Generate cross platform test binaries | |
| run: | | |
| ./gradlew linuxTestBinaries | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: native-test-binaries | |
| path: | | |
| aws-crt-kotlin/build/bin | |
| .github/scripts | |
| retention-days: 15 | |
| - name: Save Test Reports | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-reports-linux-jvm | |
| path: '**/build/reports' | |
| retention-days: 15 | |
| # test multiple os/architecture combinations for targets: linuxX64, linuxArm64 | |
| # re-use test binaries cross compiled on previous build step | |
| linux-native: | |
| runs-on: ubuntu-22.04 | |
| needs: linux | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: [x64, arm64] | |
| distro: | |
| - ubuntu-22.04 | |
| - al2023 | |
| - al2 | |
| steps: | |
| - name: Download test binaries | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: native-test-binaries | |
| path: native-test-binaries | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Test ${{ matrix.os }} on ${{ matrix.arch }} | |
| run: | | |
| chmod -R 755 native-test-binaries | |
| pwd | |
| ls -lsaR | |
| RUN_CONTAINER_TEST=./native-test-binaries/.github/scripts/run-container-test.py | |
| $RUN_CONTAINER_TEST --distro ${{ matrix.distro }} --arch ${{ matrix.arch }} --test-bin-dir ./native-test-binaries/aws-crt-kotlin/build/bin | |
| # windows JVM & native | |
| windows: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Set up MSYS2 | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MINGW64 | |
| install: >- | |
| mingw-w64-x86_64-cmake | |
| mingw-w64-x86_64-toolchain | |
| - name: Setup build environment | |
| uses: ./.github/actions/setup-build | |
| - name: Build and Test ${{ env.PACKAGE_NAME }} | |
| shell: msys2 {0} | |
| run: | | |
| ./gradlew build -Paws.crt.disableContainerTargets=mingw_x64 | |
| - name: Save Test Reports | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-reports-windows | |
| path: '**/build/reports' | |
| # TODO - native test reports? |