diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index cd65b7c75..e0a89eef6 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -89,7 +89,8 @@ jobs: name: Build & Test Unity 6 macOS 🛠️🧪 runs-on: [self-hosted, macOS] concurrency: - group: ui-tests-email-inbox-macos-unity6 + # Serialize UI runs across all platforms that share the same MailSlurp inbox / account state. + group: ui-tests-email-inbox cancel-in-progress: false # Let tests complete rather than cancelling if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneOSX-Unity6' steps: @@ -156,6 +157,43 @@ jobs: BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} working-directory: sample-unity6/Tests run: pytest -xs test/test_mac.py::MacTest + - name: Collect Unity Player logs (macOS) + if: always() + run: | + set -euo pipefail + workspaceLogs="${{ github.workspace }}/sample-unity6/player-logs" + zipPath="${{ github.workspace }}/sample-unity6/Unity6-macOS-PlayerLogs.zip" + mkdir -p "$workspaceLogs" + + # Unity Player.log location on macOS + unityLogsDir="$HOME/Library/Logs/Unity" + if [ -d "$unityLogsDir" ]; then + cp -R "$unityLogsDir" "$workspaceLogs/UnityLogs" || true + echo "Copied Unity logs from: $unityLogsDir" + else + echo "Unity logs directory not found: $unityLogsDir" + fi + + # Try to collect crash reports (if any) + diagDir="$HOME/Library/Logs/DiagnosticReports" + if [ -d "$diagDir" ]; then + mkdir -p "$workspaceLogs/DiagnosticReports" + cp -R "$diagDir/"*Sample*Unity*6*macOS* "$workspaceLogs/DiagnosticReports/" 2>/dev/null || true + cp -R "$diagDir/"*Unity* "$workspaceLogs/DiagnosticReports/" 2>/dev/null || true + echo "Attempted to copy DiagnosticReports from: $diagDir" + else + echo "DiagnosticReports directory not found: $diagDir" + fi + + rm -f "$zipPath" || true + (cd "${{ github.workspace }}/sample-unity6" && zip -r "Unity6-macOS-PlayerLogs.zip" "player-logs" >/dev/null) || true + echo "Player logs zip created: $zipPath" + - name: Upload Unity Player logs (macOS) + if: always() + uses: actions/upload-artifact@v4 + with: + name: Unity6-macOS-Player-Logs + path: sample-unity6/Unity6-macOS-PlayerLogs.zip - name: Remove temporary keychain if: always() run: | @@ -181,7 +219,8 @@ jobs: name: Build & Test Unity 6 Windows 🛠️🧪 runs-on: [self-hosted, windows] concurrency: - group: ui-tests-email-inbox-windows-unity6 + # Serialize UI runs across all platforms that share the same MailSlurp inbox / account state. + group: ui-tests-email-inbox cancel-in-progress: false # Let tests complete rather than cancelling if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneWindows64-Unity6' steps: @@ -316,6 +355,42 @@ jobs: BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} working-directory: sample-unity6/Tests run: python -m pytest -xs test/test_windows.py::WindowsTest + - name: Collect Unity Player logs (Windows) + if: always() + run: | + $playerLogRoot = Join-Path $env:USERPROFILE "AppData\LocalLow\Immutable\Sample Unity 6 Windows" + $workspaceLogs = "${{ github.workspace }}\sample-unity6\player-logs" + $zipPath = "${{ github.workspace }}\sample-unity6\Unity6-Windows-PlayerLogs.zip" + + New-Item -ItemType Directory -Force -Path $workspaceLogs | Out-Null + + if (Test-Path $playerLogRoot) { + Copy-Item -Force -Recurse "$playerLogRoot\*" $workspaceLogs -ErrorAction SilentlyContinue + Write-Output "Copied player logs from: $playerLogRoot" + } else { + Write-Output "Player log directory not found: $playerLogRoot" + } + + # Also try to capture Unity crash dumps if present + $unityCrashes = Join-Path $env:USERPROFILE "AppData\LocalLow\Unity\Crashes" + if (Test-Path $unityCrashes) { + $crashDst = Join-Path $workspaceLogs "UnityCrashes" + New-Item -ItemType Directory -Force -Path $crashDst | Out-Null + Copy-Item -Force -Recurse "$unityCrashes\*" $crashDst -ErrorAction SilentlyContinue + Write-Output "Copied Unity crashes from: $unityCrashes" + } else { + Write-Output "Unity crashes directory not found: $unityCrashes" + } + + if (Test-Path $zipPath) { Remove-Item -Force $zipPath } + Compress-Archive -Path "$workspaceLogs\*" -DestinationPath $zipPath -Force + Write-Output "Player logs zip created: $zipPath" + - name: Upload Unity Player logs (Windows) + if: always() + uses: actions/upload-artifact@v4 + with: + name: Unity6-Windows-Player-Logs + path: sample-unity6/Unity6-Windows-PlayerLogs.zip - name: Upload build log if: always() uses: actions/upload-artifact@v4 @@ -347,7 +422,9 @@ jobs: # runs-on: [ self-hosted, macOS ] # test_script: browserstack-sdk pytest -s ./test/test_android.py --browserstack.config "browserstack.android.yml" concurrency: - group: ui-tests-email-inbox-${{ matrix.concurrency_group }} + # Serialize Standalone UI tests across macOS + Windows. + # These share the same MailSlurp inbox / account state and can interfere when run in parallel. + group: ui-tests-email-inbox cancel-in-progress: false # Let tests complete rather than canceling runs-on: ${{ matrix.runs-on }} steps: diff --git a/sample/Assets/WebGLTemplates/unity-webview/Passport/index.html b/sample/Assets/WebGLTemplates/unity-webview/Passport/index.html index 5fade945c..1027645ac 100644 --- a/sample/Assets/WebGLTemplates/unity-webview/Passport/index.html +++ b/sample/Assets/WebGLTemplates/unity-webview/Passport/index.html @@ -1,4 +1,9 @@ -