Skip to content

Commit d61a51c

Browse files
ci(audience): add linux-build-smoke job for IL2CPP and Mono Linux validation
1 parent e34ad07 commit d61a51c

1 file changed

Lines changed: 108 additions & 0 deletions

File tree

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

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,114 @@ jobs:
521521
name: playmode-${{ matrix.backend }}-${{ matrix.target }}-${{ matrix.unity }}
522522
path: ${{ steps.playmode.outputs.artifactsPath }}
523523

524+
linux-build-smoke:
525+
needs: set-matrix
526+
if: |
527+
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false)
528+
|| github.event_name == 'schedule'
529+
|| github.event_name == 'workflow_dispatch'
530+
name: smoke ${{ matrix.target }} / ${{ matrix.backend }} / Unity ${{ matrix.unity }}
531+
runs-on: ubuntu-latest-8-cores
532+
timeout-minutes: 30
533+
env:
534+
AUDIENCE_TEST_CELL_ID: ${{ matrix.target }}-${{ matrix.backend }}-${{ matrix.unity }}
535+
strategy:
536+
fail-fast: false
537+
matrix:
538+
include: ${{ fromJSON(needs.set-matrix.outputs.playmode_linux) }}
539+
540+
steps:
541+
- uses: actions/checkout@v4
542+
with:
543+
lfs: true
544+
545+
- name: Inject testables passthrough (no-op)
546+
# The smoke build does not need test asmdefs; this step exists so
547+
# the Library cache key shape stays identical to the playmode-linux
548+
# job and we share warm caches.
549+
run: |
550+
jq '.' examples/audience/Packages/manifest.json > /dev/null
551+
552+
- uses: actions/cache@v4
553+
with:
554+
path: examples/audience/Library
555+
key: Library-smoke-${{ matrix.backend }}-${{ matrix.target }}-${{ matrix.unity }}-${{ hashFiles('examples/audience/Assets/**', 'examples/audience/Packages/**', 'examples/audience/ProjectSettings/**', 'src/Packages/Audience/**') }}
556+
restore-keys: |
557+
Library-smoke-${{ matrix.backend }}-${{ matrix.target }}-${{ matrix.unity }}-
558+
Library-smoke-${{ matrix.backend }}-${{ matrix.target }}-
559+
560+
- uses: game-ci/unity-builder@v4
561+
env:
562+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
563+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
564+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
565+
AUDIENCE_SCRIPTING_BACKEND: ${{ matrix.backend }}
566+
with:
567+
unityVersion: ${{ matrix.unity }}
568+
targetPlatform: ${{ matrix.target }}
569+
projectPath: examples/audience
570+
buildMethod: Immutable.Audience.Samples.SampleApp.Editor.LinuxSmokeBuilder.Build
571+
buildName: LinuxSmokePlayer
572+
customParameters: --buildPath Builds/LinuxSmoke/LinuxSmokePlayer.x86_64
573+
574+
- name: Run smoke
575+
env:
576+
AUDIENCE_TEST_PUBLISHABLE_KEY: ${{ secrets.AUDIENCE_TEST_PUBLISHABLE_KEY }}
577+
AUDIENCE_TEST_RUN_ID: ${{ github.run_id }}-${{ github.run_attempt }}
578+
shell: bash
579+
run: |
580+
set -uo pipefail
581+
player="examples/audience/Builds/LinuxSmoke/LinuxSmokePlayer.x86_64"
582+
if [ ! -x "$player" ]; then
583+
echo "::error::Built player not found at $player"
584+
ls -la "examples/audience/Builds/LinuxSmoke/" 2>/dev/null || true
585+
exit 1
586+
fi
587+
588+
mkdir -p artifacts
589+
590+
# xvfb-run guards against Linux player init failing without a
591+
# display, even with -batchmode. Cheap insurance.
592+
sudo apt-get update >/dev/null 2>&1 || true
593+
sudo apt-get install -y xvfb >/dev/null 2>&1 || true
594+
595+
xvfb-run -a --server-args="-screen 0 320x240x24 -ac" -- \
596+
"$player" -batchmode -nographics -logFile - \
597+
> artifacts/smoke.log 2>&1 &
598+
smoke_pid=$!
599+
600+
# Hard cap 60s. The runner itself enforces a 20s flush + 30s deadline;
601+
# this is just to release the cell if Application.Quit hangs.
602+
deadline=$((SECONDS + 60))
603+
while kill -0 $smoke_pid 2>/dev/null; do
604+
if [ "$SECONDS" -ge "$deadline" ]; then
605+
echo "::error::Smoke runner did not exit within 60s; killing."
606+
kill -KILL $smoke_pid 2>/dev/null || true
607+
wait $smoke_pid 2>/dev/null || true
608+
echo "----- smoke.log -----"
609+
cat artifacts/smoke.log || true
610+
exit 1
611+
fi
612+
sleep 1
613+
done
614+
615+
wait $smoke_pid
616+
rc=$?
617+
echo "Smoke exit code: $rc"
618+
echo "----- smoke.log (tail 80) -----"
619+
tail -n 80 artifacts/smoke.log || true
620+
exit $rc
621+
622+
- name: Upload smoke artifacts
623+
if: always()
624+
uses: actions/upload-artifact@v4
625+
with:
626+
name: linux-build-smoke-${{ matrix.backend }}-${{ matrix.target }}-${{ matrix.unity }}
627+
if-no-files-found: ignore
628+
path: |
629+
artifacts/smoke.log
630+
examples/audience/Builds/LinuxSmoke/**
631+
524632
# Mobile IL2CPP build validation — runs on GitHub-hosted Ubuntu via GameCI Docker
525633
# containers so self-hosted macOS/Windows machines are not occupied.
526634
# Scope: IL2CPP compile pipeline only. Runtime tests require a real device and

0 commit comments

Comments
 (0)