Skip to content

Commit a6138db

Browse files
ci(audience-sdk): add PlayMode test workflow [SDK-148]
Four-cell matrix builds the audience sample app and runs PlayMode tests inside the built player across both backends: - StandaloneWindows64 / IL2CPP / windows-latest / Unity 2021.3.45f2 - StandaloneWindows64 / Mono2x / windows-latest / Unity 2021.3.45f2 - StandaloneOSX / IL2CPP / macos-latest / Unity 2021.3.45f2 - StandaloneOSX / Mono2x / macos-latest / Unity 2021.3.45f2 Backend selection per cell goes through AUDIENCE_SCRIPTING_BACKEND env var consumed by the ScriptingBackendOverride Editor script. Notes: - Both targets use Windows / macOS hosts because game-ci can cross- build Windows IL2CPP players on Linux but the runner can't launch them to drive PlayMode tests; the host OS must match the player target. - Unity 2021.3.45f2 (not 2021.3.26f1 as originally planned) avoids a zlib-vs-macOS-15-SDK toolchain incompatibility that breaks the IL2CPP build under newer Xcode CLT (Unity zutil.h:147 macros fdopen to NULL, collides with stdio.h fdopen function declaration). - Tests live-fire to sandbox via AUDIENCE_TEST_PUBLISHABLE_KEY repo secret. Skipped on fork PRs to avoid secret leakage. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7d72558 commit a6138db

1 file changed

Lines changed: 74 additions & 0 deletions

File tree

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Audience SDK — PlayMode (IL2CPP + Mono)
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'src/Packages/Audience/**'
7+
- 'examples/audience/**'
8+
- '.github/workflows/test-audience-il2cpp.yml'
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
playmode:
17+
if: github.event.pull_request.head.repo.fork == false
18+
name: ${{ matrix.target }} / ${{ matrix.backend }} / Unity ${{ matrix.unity }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
include:
23+
# Windows players must run on a Windows host — game-ci can
24+
# cross-build the player on Linux but PlayMode tests need to launch
25+
# the player, which requires the host OS to match the target.
26+
- target: StandaloneWindows64
27+
backend: IL2CPP
28+
unity: 2021.3.45f2
29+
os: windows-latest
30+
- target: StandaloneWindows64
31+
backend: Mono2x
32+
unity: 2021.3.45f2
33+
os: windows-latest
34+
- target: StandaloneOSX
35+
backend: IL2CPP
36+
unity: 2021.3.45f2
37+
os: macos-latest
38+
- target: StandaloneOSX
39+
backend: Mono2x
40+
unity: 2021.3.45f2
41+
os: macos-latest
42+
runs-on: ${{ matrix.os }}
43+
steps:
44+
- uses: actions/checkout@v4
45+
with:
46+
fetch-depth: 0
47+
lfs: true
48+
- run: git lfs pull
49+
- uses: actions/cache@v3
50+
with:
51+
path: examples/audience/Library
52+
key: Library-${{ matrix.backend }}-${{ matrix.target }}-${{ matrix.unity }}-${{ hashFiles('examples/audience/Assets/**', 'examples/audience/Packages/**', 'examples/audience/ProjectSettings/**', 'src/Packages/Audience/**') }}
53+
restore-keys: |
54+
Library-${{ matrix.backend }}-${{ matrix.target }}-${{ matrix.unity }}
55+
Library-${{ matrix.backend }}-${{ matrix.target }}
56+
- uses: game-ci/unity-test-runner@v4
57+
id: tests
58+
env:
59+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
60+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
61+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
62+
AUDIENCE_TEST_PUBLISHABLE_KEY: ${{ secrets.AUDIENCE_TEST_PUBLISHABLE_KEY }}
63+
AUDIENCE_SCRIPTING_BACKEND: ${{ matrix.backend }}
64+
with:
65+
unityVersion: ${{ matrix.unity }}
66+
projectPath: 'examples/audience'
67+
testMode: 'PlayMode'
68+
targetPlatform: ${{ matrix.target }}
69+
githubToken: ${{ secrets.GITHUB_TOKEN }}
70+
- uses: actions/upload-artifact@v4
71+
if: always()
72+
with:
73+
name: playmode-${{ matrix.backend }}-${{ matrix.target }}-${{ matrix.unity }}
74+
path: ${{ steps.tests.outputs.artifactsPath }}

0 commit comments

Comments
 (0)