Skip to content

Commit 2d70e20

Browse files
nattb8claude
andcommitted
ci(audience): add Android + iOS IL2CPP build cells to sample app workflow (SDK-313)
Extends the matrix with 6 new macOS cells (3 Unity LTS × Android + iOS). Each cell installs the appropriate Unity module (android/ios), runs the IL2CPP build via -executeMethod, and uploads unity.log + APK as artifacts. PlayMode tests, player log capture, and test reporter are gated to non-mobile cells only — runtime tests require a real device which is not available on the self-hosted runners. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 76b5c8d commit 2d70e20

1 file changed

Lines changed: 88 additions & 6 deletions

File tree

.github/workflows/test-audience-sample-app.yml

Lines changed: 88 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,57 @@ jobs:
8686
unity: 2022.3.62f2
8787
changeset: 7670c08855a9
8888
runner: [self-hosted, macOS, ARM64]
89+
# Mobile IL2CPP build cells — macOS only, no device required.
90+
# Validates the IL2CPP compile pipeline; runtime tests need a real device
91+
# and are out of scope until a device farm is available.
92+
- target: Android
93+
backend: IL2CPP
94+
unity: 2021.3.45f2
95+
changeset: 88f88f591b2e
96+
runner: [self-hosted, macOS, ARM64]
97+
mobile: true
98+
module: android
99+
method: AndroidBuilder.Build
100+
- target: Android
101+
backend: IL2CPP
102+
unity: 2022.3.62f2
103+
changeset: 7670c08855a9
104+
runner: [self-hosted, macOS, ARM64]
105+
mobile: true
106+
module: android
107+
method: AndroidBuilder.Build
108+
- target: Android
109+
backend: IL2CPP
110+
unity: 6000.4.0f1
111+
changeset: 8cf496087c8f
112+
runner: [self-hosted, macOS, ARM64]
113+
mobile: true
114+
module: android
115+
method: AndroidBuilder.Build
116+
- target: iOS
117+
backend: IL2CPP
118+
unity: 2021.3.45f2
119+
changeset: 88f88f591b2e
120+
runner: [self-hosted, macOS, ARM64]
121+
mobile: true
122+
module: ios
123+
method: IosBuilder.Build
124+
- target: iOS
125+
backend: IL2CPP
126+
unity: 2022.3.62f2
127+
changeset: 7670c08855a9
128+
runner: [self-hosted, macOS, ARM64]
129+
mobile: true
130+
module: ios
131+
method: IosBuilder.Build
132+
- target: iOS
133+
backend: IL2CPP
134+
unity: 6000.4.0f1
135+
changeset: 8cf496087c8f
136+
runner: [self-hosted, macOS, ARM64]
137+
mobile: true
138+
module: ios
139+
method: IosBuilder.Build
89140
runs-on: ${{ matrix.runner }}
90141
timeout-minutes: 60
91142

@@ -200,7 +251,14 @@ jobs:
200251
|| echo "(install non-zero — OK if 'Editor already installed in this location')"
201252
echo "::endgroup::"
202253
203-
if [ "${{ matrix.backend }}" = "IL2CPP" ]; then
254+
if [ "${{ matrix.mobile }}" = "true" ]; then
255+
echo "::group::install ${{ matrix.module }} module"
256+
"$HUB" -- --headless install-modules \
257+
--version "$UNITY_VER" --changeset "$UNITY_CS" --architecture arm64 \
258+
--module "${{ matrix.module }}" \
259+
|| echo "(install-modules non-zero — OK if 'No modules found to install')"
260+
echo "::endgroup::"
261+
elif [ "${{ matrix.backend }}" = "IL2CPP" ]; then
204262
echo "::group::install mac-il2cpp module"
205263
"$HUB" -- --headless install-modules \
206264
--version "$UNITY_VER" --changeset "$UNITY_CS" --architecture arm64 \
@@ -227,7 +285,7 @@ jobs:
227285
228286
MISSING=""
229287
[ -z "$EDITOR_APP" ] && MISSING="editor"
230-
[ "${{ matrix.backend }}" = "IL2CPP" ] && [ -z "$IL2CPP_DIR" ] && MISSING="${MISSING:+$MISSING+}mac-il2cpp"
288+
[ "${{ matrix.backend }}" = "IL2CPP" ] && [ "${{ matrix.mobile }}" != "true" ] && [ -z "$IL2CPP_DIR" ] && MISSING="${MISSING:+$MISSING+}mac-il2cpp"
231289
if [ -n "$MISSING" ]; then
232290
echo "::error::Unity $UNITY_VER missing: $MISSING"
233291
ls -la /Applications/Unity/Hub/Editor/ 2>&1 || true
@@ -281,7 +339,7 @@ jobs:
281339
"UNITY_PATH=$editor" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
282340
283341
- name: Run PlayMode tests (macOS)
284-
if: runner.os == 'macOS'
342+
if: runner.os == 'macOS' && matrix.mobile != true
285343
shell: bash
286344
env:
287345
AUDIENCE_TEST_PUBLISHABLE_KEY: ${{ secrets.AUDIENCE_TEST_PUBLISHABLE_KEY }}
@@ -303,6 +361,20 @@ jobs:
303361
-testResults "$(pwd)/artifacts/test-results.xml" \
304362
-logFile - 2>&1 | tee "$(pwd)/artifacts/unity.log"
305363
364+
- name: Build mobile target (macOS)
365+
if: runner.os == 'macOS' && matrix.mobile == true
366+
shell: bash
367+
run: |
368+
set -euo pipefail
369+
mkdir -p artifacts
370+
"$UNITY_PATH" \
371+
-batchmode -nographics \
372+
-projectPath examples/audience \
373+
-buildTarget ${{ matrix.target }} \
374+
-executeMethod Immutable.Audience.Samples.SampleApp.Editor.${{ matrix.method }} \
375+
-quit \
376+
-logFile - 2>&1 | tee "$(pwd)/artifacts/unity.log"
377+
306378
- name: Run PlayMode tests (Windows)
307379
if: runner.os == 'Windows'
308380
shell: pwsh
@@ -336,7 +408,7 @@ jobs:
336408
git config --global --add safe.directory $env:GITHUB_WORKSPACE.Replace('\','/')
337409
338410
- name: Capture player log (macOS)
339-
if: always() && runner.os == 'macOS'
411+
if: always() && runner.os == 'macOS' && matrix.mobile != true
340412
shell: bash
341413
run: |
342414
# The test-runner builds + launches a player binary that writes its own
@@ -416,19 +488,29 @@ jobs:
416488
417489
- name: Publish test report
418490
uses: dorny/test-reporter@v3
419-
if: always()
491+
if: always() && matrix.mobile != true
420492
with:
421493
name: PlayMode (${{ matrix.backend }} / ${{ matrix.target }})
422494
path: artifacts/test-results.xml
423495
reporter: dotnet-nunit
424496
fail-on-error: true
425497

426498
- uses: actions/upload-artifact@v4
427-
if: always()
499+
if: always() && matrix.mobile != true
428500
with:
429501
name: playmode-${{ matrix.backend }}-${{ matrix.target }}-${{ matrix.unity }}
430502
path: |
431503
artifacts/test-results.xml
432504
artifacts/unity.log
433505
artifacts/Player-*.log
434506
examples/audience/Logs/**
507+
508+
- uses: actions/upload-artifact@v4
509+
if: always() && matrix.mobile == true
510+
with:
511+
name: mobile-build-${{ matrix.target }}-${{ matrix.unity }}
512+
if-no-files-found: ignore
513+
path: |
514+
artifacts/unity.log
515+
examples/audience/Builds/Android/*.apk
516+
examples/audience/Logs/**

0 commit comments

Comments
 (0)