feat: Kotlin/Native Windows compilation #484
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 | |
| 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: 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, macoArm64, iosSimulatorArm64, watchosSimulatorArm65, tvosSimulatorArm64 | |
| # macos-13 build and test for targets: jvm, macoX64, 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: | | |
| ./gradlew build | |
| - 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: Setup build environment | |
| uses: ./.github/actions/setup-build | |
| # - name: Install Docker | |
| # run: | | |
| # echo "Installing docker via chocolatey..." | |
| # choco install -y -v docker-desktop | |
| # | |
| # echo "Looking for DockerCli.exe via hardcoded path:" | |
| # ls "/c/Program Files/Docker/Docker" || true | |
| - name: Install Podman? | |
| run: | | |
| echo "Installing podman via chocolatey..." | |
| choco install -y -v podman-desktop | |
| echo "Looking for podman in PATH:" | |
| podman info || echo "podman not found in PATH" | |
| echo "Dumping Program Files:" | |
| ls "C:\Program Files\" | |
| - name: Configure Docker Images | |
| shell: bash | |
| run: | | |
| echo "Building Docker images" | |
| ./docker-images/build-images.sh mingw-x64 | |
| echo "Built images:" | |
| ls dockcross-* | |
| - name: Build and Test ${{ env.PACKAGE_NAME }} | |
| run: | | |
| ./gradlew build | |
| - name: Save Test Reports | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-reports-windows | |
| path: '**/build/reports' | |
| # TODO - native test reports? |