Skip to content

Commit 93b7a32

Browse files
ci: add Windows matrix to Android build (AppAndFlow#726)
* ci: add Windows matrix to Android build * ci: use subst on Windows to avoid MAX_PATH in CMake object names * ci: merge per-OS build steps into single bash branch * ci: extract Android build to scripts/build-android.sh * ci: delegate Windows Android build to companion .cmd file
1 parent 3ec2ff3 commit 93b7a32

3 files changed

Lines changed: 37 additions & 6 deletions

File tree

.github/scripts/build-android.cmd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@echo off
2+
setlocal
3+
rem subst the workspace to a short drive to avoid Windows MAX_PATH in
4+
rem CMake-generated object file names from autolinked codegen.
5+
subst W: "%GITHUB_WORKSPACE%" || exit /b 1
6+
cd /D W:\example\android || exit /b 1
7+
call gradlew.bat assembleDebug -PnewArchEnabled=%1

.github/scripts/build-android.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
new_arch="${1:-false}"
5+
6+
if [[ "${RUNNER_OS:-}" == "Windows" ]]; then
7+
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8+
cmd //c "$(cygpath -w "$script_dir/build-android.cmd")" "$new_arch"
9+
else
10+
cd example/android
11+
./gradlew assembleDebug -PnewArchEnabled="${new_arch}"
12+
fi

.github/workflows/android.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ on:
1818

1919
jobs:
2020
android-build:
21-
runs-on: ubuntu-latest
21+
runs-on: ${{ matrix.os }}
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
os: [ubuntu-latest, windows-latest]
26+
defaults:
27+
run:
28+
shell: bash
2229
steps:
2330
- uses: actions/checkout@v4
2431
- name: Use Node.js 20.x
@@ -43,10 +50,16 @@ jobs:
4350
run: yarn install
4451
working-directory: example
4552
- name: Build android example app with new arch disabled
46-
run: ./gradlew assembleDebug -PnewArchEnabled=false
47-
working-directory: example/android
53+
run: ./.github/scripts/build-android.sh false
4854
android-build-fabric:
49-
runs-on: ubuntu-latest
55+
runs-on: ${{ matrix.os }}
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
os: [ubuntu-latest, windows-latest]
60+
defaults:
61+
run:
62+
shell: bash
5063
steps:
5164
- uses: actions/checkout@v4
5265
- name: Use Node.js 20.x
@@ -71,5 +84,4 @@ jobs:
7184
run: yarn install
7285
working-directory: example
7386
- name: Build android example app with new arch enabled
74-
run: ./gradlew assembleDebug -PnewArchEnabled=true
75-
working-directory: example/android
87+
run: ./.github/scripts/build-android.sh true

0 commit comments

Comments
 (0)