From 8a67e0b9b0ef179df642b8d8ed939348d9543746 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Fri, 15 May 2026 13:29:57 -0400 Subject: [PATCH 1/5] ci: add Windows matrix to Android build --- .github/workflows/android.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 40eaf10b..4ba03632 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 @@ -46,7 +53,14 @@ jobs: run: ./gradlew assembleDebug -PnewArchEnabled=false working-directory: example/android 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 From 88833df77511150a4dad437eb9607c8c5d761746 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Fri, 15 May 2026 13:45:59 -0400 Subject: [PATCH 2/5] ci: use subst on Windows to avoid MAX_PATH in CMake object names --- .github/workflows/android.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 4ba03632..8e1cf8e7 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -50,8 +50,16 @@ jobs: run: yarn install working-directory: example - name: Build android example app with new arch disabled + if: runner.os != 'Windows' run: ./gradlew assembleDebug -PnewArchEnabled=false working-directory: example/android + - name: Build android example app with new arch disabled (Windows) + if: runner.os == 'Windows' + shell: cmd + run: | + subst W: "%GITHUB_WORKSPACE%" + cd /D W:\example\android + call gradlew.bat assembleDebug -PnewArchEnabled=false android-build-fabric: runs-on: ${{ matrix.os }} strategy: @@ -85,5 +93,13 @@ jobs: run: yarn install working-directory: example - name: Build android example app with new arch enabled + if: runner.os != 'Windows' run: ./gradlew assembleDebug -PnewArchEnabled=true working-directory: example/android + - name: Build android example app with new arch enabled (Windows) + if: runner.os == 'Windows' + shell: cmd + run: | + subst W: "%GITHUB_WORKSPACE%" + cd /D W:\example\android + call gradlew.bat assembleDebug -PnewArchEnabled=true From 901d9b032f2073b07bbf27ed14759ecedc7ad9b2 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Fri, 15 May 2026 14:23:44 -0400 Subject: [PATCH 3/5] ci: merge per-OS build steps into single bash branch --- .github/workflows/android.yml | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 8e1cf8e7..c9413b91 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -50,16 +50,15 @@ jobs: run: yarn install working-directory: example - name: Build android example app with new arch disabled - if: runner.os != 'Windows' - run: ./gradlew assembleDebug -PnewArchEnabled=false - working-directory: example/android - - name: Build android example app with new arch disabled (Windows) - if: runner.os == 'Windows' - shell: cmd run: | - subst W: "%GITHUB_WORKSPACE%" - cd /D W:\example\android - call gradlew.bat assembleDebug -PnewArchEnabled=false + if [[ "$RUNNER_OS" == "Windows" ]]; then + # subst the workspace to a short drive to avoid Windows MAX_PATH + # in CMake-generated object file names from autolinked codegen. + MSYS_NO_PATHCONV=1 cmd /c 'subst W: "%GITHUB_WORKSPACE%" && cd /D W:\example\android && call gradlew.bat assembleDebug -PnewArchEnabled=false' + else + cd example/android + ./gradlew assembleDebug -PnewArchEnabled=false + fi android-build-fabric: runs-on: ${{ matrix.os }} strategy: @@ -93,13 +92,12 @@ jobs: run: yarn install working-directory: example - name: Build android example app with new arch enabled - if: runner.os != 'Windows' - run: ./gradlew assembleDebug -PnewArchEnabled=true - working-directory: example/android - - name: Build android example app with new arch enabled (Windows) - if: runner.os == 'Windows' - shell: cmd run: | - subst W: "%GITHUB_WORKSPACE%" - cd /D W:\example\android - call gradlew.bat assembleDebug -PnewArchEnabled=true + if [[ "$RUNNER_OS" == "Windows" ]]; then + # subst the workspace to a short drive to avoid Windows MAX_PATH + # in CMake-generated object file names from autolinked codegen. + MSYS_NO_PATHCONV=1 cmd /c 'subst W: "%GITHUB_WORKSPACE%" && cd /D W:\example\android && call gradlew.bat assembleDebug -PnewArchEnabled=true' + else + cd example/android + ./gradlew assembleDebug -PnewArchEnabled=true + fi From 01ebb108152bfad7f77c3666852e8e6cc50b1aec Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Fri, 15 May 2026 14:25:11 -0400 Subject: [PATCH 4/5] ci: extract Android build to scripts/build-android.sh --- .github/scripts/build-android.sh | 15 +++++++++++++++ .github/workflows/android.yml | 20 ++------------------ 2 files changed, 17 insertions(+), 18 deletions(-) create mode 100755 .github/scripts/build-android.sh diff --git a/.github/scripts/build-android.sh b/.github/scripts/build-android.sh new file mode 100755 index 00000000..e46d6d61 --- /dev/null +++ b/.github/scripts/build-android.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euo pipefail + +new_arch="${1:-false}" + +if [[ "${RUNNER_OS:-}" == "Windows" ]]; then + # GitHub's Windows workspace path (`D:\a\\\…`) is ~70 chars + # before nesting. Combined with autolinked codegen object file names (which + # encode the full source path), it blows past Windows' 260-char MAX_PATH + # limit. subst aliases the workspace to a short drive to keep paths short. + cmd //c "subst W: \"%GITHUB_WORKSPACE%\" && cd /D W:\\example\\android && call gradlew.bat assembleDebug -PnewArchEnabled=${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 c9413b91..b0e1e564 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -50,15 +50,7 @@ jobs: run: yarn install working-directory: example - name: Build android example app with new arch disabled - run: | - if [[ "$RUNNER_OS" == "Windows" ]]; then - # subst the workspace to a short drive to avoid Windows MAX_PATH - # in CMake-generated object file names from autolinked codegen. - MSYS_NO_PATHCONV=1 cmd /c 'subst W: "%GITHUB_WORKSPACE%" && cd /D W:\example\android && call gradlew.bat assembleDebug -PnewArchEnabled=false' - else - cd example/android - ./gradlew assembleDebug -PnewArchEnabled=false - fi + run: ./.github/scripts/build-android.sh false android-build-fabric: runs-on: ${{ matrix.os }} strategy: @@ -92,12 +84,4 @@ jobs: run: yarn install working-directory: example - name: Build android example app with new arch enabled - run: | - if [[ "$RUNNER_OS" == "Windows" ]]; then - # subst the workspace to a short drive to avoid Windows MAX_PATH - # in CMake-generated object file names from autolinked codegen. - MSYS_NO_PATHCONV=1 cmd /c 'subst W: "%GITHUB_WORKSPACE%" && cd /D W:\example\android && call gradlew.bat assembleDebug -PnewArchEnabled=true' - else - cd example/android - ./gradlew assembleDebug -PnewArchEnabled=true - fi + run: ./.github/scripts/build-android.sh true From 476777c564ad5431358c25bb2fb4035c7b894378 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Fri, 15 May 2026 14:33:24 -0400 Subject: [PATCH 5/5] ci: delegate Windows Android build to companion .cmd file --- .github/scripts/build-android.cmd | 7 +++++++ .github/scripts/build-android.sh | 7 ++----- 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 .github/scripts/build-android.cmd diff --git a/.github/scripts/build-android.cmd b/.github/scripts/build-android.cmd new file mode 100644 index 00000000..9038beda --- /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 index e46d6d61..c353f610 100755 --- a/.github/scripts/build-android.sh +++ b/.github/scripts/build-android.sh @@ -4,11 +4,8 @@ set -euo pipefail new_arch="${1:-false}" if [[ "${RUNNER_OS:-}" == "Windows" ]]; then - # GitHub's Windows workspace path (`D:\a\\\…`) is ~70 chars - # before nesting. Combined with autolinked codegen object file names (which - # encode the full source path), it blows past Windows' 260-char MAX_PATH - # limit. subst aliases the workspace to a short drive to keep paths short. - cmd //c "subst W: \"%GITHUB_WORKSPACE%\" && cd /D W:\\example\\android && call gradlew.bat assembleDebug -PnewArchEnabled=${new_arch}" + 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}"