diff --git a/.github/scripts/build-android.cmd b/.github/scripts/build-android.cmd new file mode 100644 index 0000000..9038bed --- /dev/null +++ b/.github/scripts/build-android.cmd @@ -0,0 +1,7 @@ +@echo off +setlocal +rem subst the workspace to a short drive to avoid Windows MAX_PATH in +rem CMake-generated object file names from autolinked codegen. +subst W: "%GITHUB_WORKSPACE%" || exit /b 1 +cd /D W:\example\android || exit /b 1 +call gradlew.bat assembleDebug -PnewArchEnabled=%1 diff --git a/.github/scripts/build-android.sh b/.github/scripts/build-android.sh new file mode 100755 index 0000000..c353f61 --- /dev/null +++ b/.github/scripts/build-android.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euo pipefail + +new_arch="${1:-false}" + +if [[ "${RUNNER_OS:-}" == "Windows" ]]; then + script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + cmd //c "$(cygpath -w "$script_dir/build-android.cmd")" "$new_arch" +else + cd example/android + ./gradlew assembleDebug -PnewArchEnabled="${new_arch}" +fi diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 40eaf10..b0e1e56 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -18,7 +18,14 @@ on: jobs: android-build: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + defaults: + run: + shell: bash steps: - uses: actions/checkout@v4 - name: Use Node.js 20.x @@ -43,10 +50,16 @@ jobs: run: yarn install working-directory: example - name: Build android example app with new arch disabled - run: ./gradlew assembleDebug -PnewArchEnabled=false - working-directory: example/android + run: ./.github/scripts/build-android.sh false android-build-fabric: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + defaults: + run: + shell: bash steps: - uses: actions/checkout@v4 - name: Use Node.js 20.x @@ -71,5 +84,4 @@ jobs: run: yarn install working-directory: example - name: Build android example app with new arch enabled - run: ./gradlew assembleDebug -PnewArchEnabled=true - working-directory: example/android + run: ./.github/scripts/build-android.sh true