From 3522ca860dcf0eb3914fd4d08ace1fbdebc13646 Mon Sep 17 00:00:00 2001 From: Daniel Sierpinski Date: Fri, 4 Dec 2026 11:49:12 +0100 Subject: [PATCH] Retry the Android sample build once after an IL2CPP segfault. A UnityLinker or il2cpp crash exits 139 and fails the job even though the same build usually passes on the next attempt. Co-authored-by: Cursor --- .github/workflows/main.ci.cd.workflow.yml | 28 ++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.ci.cd.workflow.yml b/.github/workflows/main.ci.cd.workflow.yml index 3b50fa74..ef6689dc 100644 --- a/.github/workflows/main.ci.cd.workflow.yml +++ b/.github/workflows/main.ci.cd.workflow.yml @@ -229,7 +229,12 @@ jobs: run: | git diff - - name: Build Sample Project + # UnityLinker and il2cpp sometimes SIGSEGV (exit 139) during the Android player + # build. The same job usually passes on a second attempt. One retry, with the + # same leftover-container and license cleanup the test steps use. + - name: Build Sample Project (Attempt 1) + id: build_sample_1 + continue-on-error: true uses: game-ci/unity-builder@v4 env: UNITY_EMAIL: ${{ vars.UNITY_EMAIL }} @@ -247,7 +252,28 @@ jobs: customImage: ${{ env.DOCKER_TAG }} allowDirtyBuild: true #Needed because the import process may update ProjectSettings + - name: Reset Unity state before build retry + if: steps.build_sample_1.outcome == 'failure' + run: bash .github/workflows/scripts/reset-unity-state.sh + + - name: Build Sample Project (Attempt 2) + id: build_sample_2 + if: steps.build_sample_1.outcome == 'failure' + uses: game-ci/unity-builder@v4 + env: + UNITY_EMAIL: ${{ vars.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + with: + targetPlatform: ${{ matrix.target_platform == 'android' && 'Android' || '' }} + androidTargetSdkVersion: ${{ matrix.target_platform == 'android' && 'AndroidApiLevel33' || '' }} + buildMethod: StreamVideo.EditorTools.StreamEditorTools.BuildSampleApp + customParameters: -apiCompatibility ${{ matrix.dotnet_version }} -scriptingBackend ${{ matrix.compiler }} -buildTargetPlatform ${{ matrix.target_platform }} -buildTargetPath SampleAppBuild/${{ env.BUILD_NAME }} + customImage: ${{ env.DOCKER_TAG }} + allowDirtyBuild: true #Needed because the import process may update ProjectSettings + - name: Upload Build as Artifact + if: steps.build_sample_1.outcome == 'success' || steps.build_sample_2.outcome == 'success' uses: actions/upload-artifact@v4 with: name: Build_${{ env.BUILD_NAME }}