From 4d9c6fb7054108fb1c7d4c2e8e779b2e3ee9ab31 Mon Sep 17 00:00:00 2001 From: ImmutableJeffrey Date: Thu, 7 May 2026 12:03:40 +1000 Subject: [PATCH] ci(audience): add Linux desktop to the PlayMode CI matrix (SDK-255) - Adds LinuxStandalone64 to includePlatforms in src/Packages/Audience/Runtime/com.immutable.audience.asmdef and src/Packages/Audience/Runtime/Unity/com.immutable.audience.unity.asmdef so the SDK compiles when the build target is Linux. Without these, the sample app errors with CS0246 for every audience type. The Tests asmdef already included Linux. - Adds a playmode-linux job in .github/workflows/test-audience-sample-app.yml that runs the audience PlayMode tests on ubuntu-latest-8-cores via game-ci/unity-test-runner@v4. Covers IL2CPP and Mono2x backends for Unity 2021.3.45f2, 6000.4.0f1, and 2022.3.62f2, matching the Win/macOS coverage. - Linux runs via GameCI on GitHub-hosted Ubuntu rather than a self-hosted machine. Self-hosted Linux on residential bandwidth spent ~170s per job uploading the Library cache; GameCI completes the same work in ~138s and keeps self-hosted runners free for Win/macOS. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../workflows/test-audience-sample-app.yml | 58 +++++++++++++++++++ .../Unity/com.immutable.audience.unity.asmdef | 2 +- .../Runtime/com.immutable.audience.asmdef | 2 +- 3 files changed, 60 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-audience-sample-app.yml b/.github/workflows/test-audience-sample-app.yml index 3dbdf01d..32baf51b 100644 --- a/.github/workflows/test-audience-sample-app.yml +++ b/.github/workflows/test-audience-sample-app.yml @@ -405,6 +405,64 @@ jobs: artifacts/Player-*.log examples/audience/Logs/** + playmode-linux: + if: | + (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false) + || github.event_name == 'schedule' + || github.event_name == 'workflow_dispatch' + name: ${{ matrix.target }} / ${{ matrix.backend }} / Unity ${{ matrix.unity }} + runs-on: ubuntu-latest-8-cores + strategy: + fail-fast: false + matrix: + unity: ['2021.3.45f2', '6000.4.0f1', '2022.3.62f2'] + target: [StandaloneLinux64] + backend: [IL2CPP, Mono2x] + exclude: ${{ fromJSON(github.event_name == 'pull_request' && '[{"unity":"2022.3.62f2"}]' || '[]') }} + + steps: + - uses: actions/checkout@v4 + with: + lfs: true + + - uses: actions/cache@v4 + with: + path: examples/audience/Library + key: Library-${{ matrix.backend }}-${{ matrix.target }}-${{ matrix.unity }}-${{ hashFiles('examples/audience/Assets/**', 'examples/audience/Packages/**', 'examples/audience/ProjectSettings/**', 'src/Packages/Audience/**') }} + restore-keys: | + Library-${{ matrix.backend }}-${{ matrix.target }}-${{ matrix.unity }}- + Library-${{ matrix.backend }}-${{ matrix.target }}- + + - uses: game-ci/unity-test-runner@v4 + id: playmode + env: + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} + AUDIENCE_TEST_PUBLISHABLE_KEY: ${{ secrets.AUDIENCE_TEST_PUBLISHABLE_KEY }} + AUDIENCE_SCRIPTING_BACKEND: ${{ matrix.backend }} + with: + unityVersion: ${{ matrix.unity }} + targetPlatform: ${{ matrix.target }} + projectPath: examples/audience + testMode: playmode + githubToken: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish test report + uses: dorny/test-reporter@v3 + if: always() + with: + name: PlayMode (${{ matrix.backend }} / ${{ matrix.target }}) + path: ${{ steps.playmode.outputs.artifactsPath }}/playmode-results.xml + reporter: dotnet-nunit + fail-on-error: true + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: playmode-${{ matrix.backend }}-${{ matrix.target }}-${{ matrix.unity }} + path: ${{ steps.playmode.outputs.artifactsPath }} + # Mobile IL2CPP build validation — runs on GitHub-hosted Ubuntu via GameCI Docker # containers so self-hosted macOS/Windows machines are not occupied. # Scope: IL2CPP compile pipeline only. Runtime tests require a real device and diff --git a/src/Packages/Audience/Runtime/Unity/com.immutable.audience.unity.asmdef b/src/Packages/Audience/Runtime/Unity/com.immutable.audience.unity.asmdef index 9a03d62a..2ba8c0b9 100644 --- a/src/Packages/Audience/Runtime/Unity/com.immutable.audience.unity.asmdef +++ b/src/Packages/Audience/Runtime/Unity/com.immutable.audience.unity.asmdef @@ -2,7 +2,7 @@ "name": "Immutable.Audience.Unity", "rootNamespace": "Immutable.Audience.Unity", "references": ["Immutable.Audience.Runtime"], - "includePlatforms": ["Android", "Editor", "iOS", "macOSStandalone", "WindowsStandalone64"], + "includePlatforms": ["Android", "Editor", "iOS", "LinuxStandalone64", "macOSStandalone", "WindowsStandalone64"], "excludePlatforms": [], "allowUnsafeCode": false, "overrideReferences": false, diff --git a/src/Packages/Audience/Runtime/com.immutable.audience.asmdef b/src/Packages/Audience/Runtime/com.immutable.audience.asmdef index 0288815d..acc15719 100644 --- a/src/Packages/Audience/Runtime/com.immutable.audience.asmdef +++ b/src/Packages/Audience/Runtime/com.immutable.audience.asmdef @@ -2,7 +2,7 @@ "name": "Immutable.Audience.Runtime", "rootNamespace": "Immutable.Audience", "references": [], - "includePlatforms": ["Android", "Editor", "iOS", "macOSStandalone", "WindowsStandalone64"], + "includePlatforms": ["Android", "Editor", "iOS", "LinuxStandalone64", "macOSStandalone", "WindowsStandalone64"], "excludePlatforms": [], "allowUnsafeCode": false, "overrideReferences": false,