@@ -27,77 +27,33 @@ jobs:
2727 SENTRY_DSN : ${{ secrets.DSN }}
2828 run : |
2929 $exePath = Get-ChildItem -Path "./build" -Filter "SentaurSurvivors-*.exe" -Recurse | Select-Object -First 1
30- if ($exePath) {
30+ if ($exePath)
31+ {
3132 Write-Output "Found executable: $($exePath.FullName)"
32- Write-Output "SENTRY_DSN is set: $(![string]::IsNullOrEmpty($env:SENTRY_DSN))"
33- Write-Output "SENTRY_DSN length: $($env:SENTRY_DSN.Length)"
3433 $startTime = Get-Date
35- Start-Process -FilePath $exePath -Wait -PassThru -NoNewWindow -Environment @{
36- SENTRY_DSN = $env:SENTRY_DSN
37- }
34+
35+ Start-Process -FilePath $exePath -Wait -PassThru -NoNewWindow
36+
3837 $endTime = Get-Date
3938 $duration = $endTime - $startTime
4039 Write-Output "Game finished in $($duration.ToString('hh\:mm\:ss'))"
4140
42- # Capture Unity logs
4341 $logPath = "$env:USERPROFILE\AppData\LocalLow\Sentry\SentaurSurvivors\Player.log"
44- if (Test-Path $logPath) {
45- Write-Output "::group::Unity Game Logs"
42+ if (Test-Path $logPath)
43+ {
44+ Write-Output "::group::Game Logs"
4645 Get-Content $logPath
4746 Write-Output "::endgroup::"
48- } else {
47+ }
48+ else
49+ {
4950 Write-Output "Unity log file not found at: $logPath"
5051 }
5152
52- Write-Output "Build executed successfully"
53- } else {
53+ Write-Output "Run executed successfully"
54+ }
55+ else
56+ {
5457 Write-Error "No SentaurSurvivors executable found in build artifacts"
5558 exit 1
56- }
57- - name : Run Android Emulator
58- uses : reactivecircus/android-emulator-runner@v2
59- env :
60- SENTRY_DSN : ${{ secrets.DSN }}
61- with :
62- api-level : 29
63- target : google_apis
64- arch : x86_64
65- profile : Nexus 6
66- emulator-options : -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
67- disable-animations : true
68- script : |
69- echo "Installing APK..."
70- adb install "${{ steps.find-apk.outputs.apk_path }}"
71-
72- echo "Starting app..."
73- # Get package name from installed packages (more reliable after install)
74- PACKAGE_NAME=$(adb shell pm list packages | grep sentaur | head -1 | cut -d: -f2)
75- if [ -z "$PACKAGE_NAME" ]; then
76- # Fallback: try to find Unity package pattern
77- PACKAGE_NAME=$(adb shell pm list packages | grep -i "unity\|sentry\|survivors" | head -1 | cut -d: -f2)
78- fi
79- echo "Package name: $PACKAGE_NAME"
80-
81- # For Unity apps, the main activity is typically the UnityPlayerActivity
82- MAIN_ACTIVITY="com.unity3d.player.UnityPlayerActivity"
83- echo "Main activity: $MAIN_ACTIVITY"
84-
85- # Pass DSN as Intent extra for Android runtime configuration
86- adb shell am start -n $PACKAGE_NAME/$MAIN_ACTIVITY --es dsn "$SENTRY_DSN"
87-
88- echo "App started, waiting for execution..."
89- sleep 5
90-
91- # Check if app is running
92- adb shell "ps | grep $PACKAGE_NAME" || echo "App might not be running"
93-
94- echo "Waiting for app to initialize..."
95- sleep 25
96-
97- echo "Capturing logs..."
98- adb logcat -d | grep -i "unity\|sentry\|sentaur\|dsn\|configure" || echo "No relevant logs found"
99-
100- echo "Stopping app..."
101- adb shell am force-stop $PACKAGE_NAME
102-
103- echo "Android demo completed successfully"
59+ }
0 commit comments