|
13 | 13 | - All |
14 | 14 | - StandaloneOSX # Builds Unity 2021 macOS only |
15 | 15 | - StandaloneOSX-Unity6 # Builds Unity 6 macOS only |
16 | | - - StandaloneWindows64 |
| 16 | + - StandaloneWindows64 # Builds Unity 2021 Windows only |
| 17 | + - StandaloneWindows64-Unity6 # Builds Unity 6 Windows only |
17 | 18 | # - Android |
18 | 19 | # - iOS |
19 | 20 | push: |
|
88 | 89 | name: Build & Test Unity 6 macOS 🛠️🧪 |
89 | 90 | runs-on: [self-hosted, macOS] |
90 | 91 | concurrency: |
91 | | - group: ui-tests-email-inbox-macos |
92 | | - cancel-in-progress: false # Let tests complete rather than canceling |
| 92 | + group: ui-tests-email-inbox-macos-unity6 |
| 93 | + cancel-in-progress: false # Let tests complete rather than cancelling |
93 | 94 | if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneOSX-Unity6' |
94 | 95 | steps: |
95 | 96 | - name: Cleanup old builds |
|
99 | 100 | - uses: actions/checkout@v3 |
100 | 101 | with: |
101 | 102 | lfs: true |
| 103 | + - name: Setup symlinks for Unity 6 macOS |
| 104 | + run: ./setup-symlinks.sh |
102 | 105 | - name: Force clean package resolution |
103 | 106 | run: | |
104 | 107 | echo "Removing Library folder to force clean package resolution..." |
@@ -171,7 +174,153 @@ jobs: |
171 | 174 | if: always() |
172 | 175 | uses: actions/upload-artifact@v4 |
173 | 176 | with: |
174 | | - name: Unity6-Build-Log |
| 177 | + name: Unity6-macOS-Build-Log |
| 178 | + path: sample-unity6/build-log.log |
| 179 | + |
| 180 | + build-and-test-unity6-windows: # Unity 6 requires a full build cycle to compile AltTester packages properly. This doesn't work well in Game CI, so we have to build it manually. |
| 181 | + name: Build & Test Unity 6 Windows 🛠️🧪 |
| 182 | + runs-on: [self-hosted, windows] |
| 183 | + concurrency: |
| 184 | + group: ui-tests-email-inbox-windows-unity6 |
| 185 | + cancel-in-progress: false # Let tests complete rather than cancelling |
| 186 | + if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneWindows64-Unity6' |
| 187 | + steps: |
| 188 | + - name: Cleanup old builds |
| 189 | + run: | |
| 190 | + # Remove previous build to save space |
| 191 | + if (Test-Path "sample-unity6/Tests") { Remove-Item -Recurse -Force "sample-unity6/Tests" -ErrorAction SilentlyContinue } |
| 192 | + - uses: actions/checkout@v3 |
| 193 | + with: |
| 194 | + lfs: true |
| 195 | + - name: Cache Unity Library folder |
| 196 | + uses: actions/cache@v3 |
| 197 | + with: |
| 198 | + path: sample-unity6/Library |
| 199 | + key: Library-Unity6-Windows-${{ hashFiles('sample-unity6/Assets/**', 'sample-unity6/Packages/**', 'sample-unity6/ProjectSettings/**') }} |
| 200 | + restore-keys: | |
| 201 | + Library-Unity6-Windows- |
| 202 | + - name: Setup symlinks for Unity 6 Windows |
| 203 | + run: .\setup-symlinks.ps1 |
| 204 | + - name: Verify symlinks were created |
| 205 | + run: | |
| 206 | + if (-not (Test-Path "sample-unity6/Assets/Editor/WindowsBuilderUnity6.cs")) { |
| 207 | + Write-Output "❌ Build script not found - symlink setup failed" |
| 208 | + exit 1 |
| 209 | + } |
| 210 | + Write-Output "✅ Symlinks verified" |
| 211 | + # Don't delete Library folder - let Unity reuse cached package data if available |
| 212 | + # Deleting it forces a complete reimport which takes too long |
| 213 | + - name: Ensure Tests directory exists |
| 214 | + run: | |
| 215 | + if (-not (Test-Path "sample-unity6/Tests")) { |
| 216 | + New-Item -ItemType Directory -Path "sample-unity6/Tests" -Force | Out-Null |
| 217 | + } |
| 218 | + - name: First build (resolves packages) |
| 219 | + run: | |
| 220 | + Write-Output "Running first build to trigger package resolution..." |
| 221 | + |
| 222 | + $unityPath = "C:\Program Files\Unity\Hub\Editor\6000.0.58f2\Editor\Unity.exe" |
| 223 | + $projectPath = "${{ github.workspace }}\sample-unity6" |
| 224 | + $logFile = "${{ github.workspace }}\sample-unity6\first-build-log.txt" |
| 225 | + $buildPath = "${{ github.workspace }}\sample-unity6\Tests\Sample Unity 6 Windows.exe" |
| 226 | + |
| 227 | + $arguments = @( |
| 228 | + "-projectPath", "`"$projectPath`"", |
| 229 | + "-executeMethod", "WindowsBuilderUnity6.BuildForAltTester", |
| 230 | + "-logFile", "`"$logFile`"", |
| 231 | + "-quit", "-batchmode", "-nographics", |
| 232 | + "--buildPath", "`"$buildPath`"" |
| 233 | + ) |
| 234 | + |
| 235 | + # Run and ignore exit code (may fail on first attempt) |
| 236 | + $process = Start-Process -FilePath $unityPath ` |
| 237 | + -ArgumentList $arguments ` |
| 238 | + -Wait -PassThru -NoNewWindow |
| 239 | + |
| 240 | + Write-Output "First build completed (exit code: $($process.ExitCode), may have failed, that's ok). Checking for AltTester..." |
| 241 | + |
| 242 | + if (Test-Path "${{ github.workspace }}\sample-unity6\Library\PackageCache") { |
| 243 | + $altTesterFound = Get-ChildItem "${{ github.workspace }}\sample-unity6\Library\PackageCache" -Filter "*alttester*" -ErrorAction SilentlyContinue |
| 244 | + if ($altTesterFound) { |
| 245 | + Write-Output "✅ AltTester found in PackageCache after first build" |
| 246 | + } else { |
| 247 | + Write-Output "⚠️ AltTester not found yet, but will be ready for second build" |
| 248 | + } |
| 249 | + } |
| 250 | + - name: Build Unity 6 Windows executable |
| 251 | + timeout-minutes: 20 |
| 252 | + run: | |
| 253 | + Write-Output "Building Unity 6 Windows executable..." |
| 254 | + Write-Output "Started at: $(Get-Date -Format 'HH:mm:ss')" |
| 255 | + |
| 256 | + # Run Unity build |
| 257 | + $unityPath = "C:\Program Files\Unity\Hub\Editor\6000.0.58f2\Editor\Unity.exe" |
| 258 | + $projectPath = "${{ github.workspace }}\sample-unity6" |
| 259 | + $logFile = "${{ github.workspace }}\sample-unity6\build-log.log" |
| 260 | + $buildPath = "${{ github.workspace }}\sample-unity6\Tests\Sample Unity 6 Windows.exe" |
| 261 | + |
| 262 | + # Build argument list with proper quoting for paths with spaces |
| 263 | + $arguments = @( |
| 264 | + "-projectPath", "`"$projectPath`"", |
| 265 | + "-executeMethod", "WindowsBuilderUnity6.BuildForAltTester", |
| 266 | + "-logFile", "`"$logFile`"", |
| 267 | + "-quit", "-batchmode", "-nographics", |
| 268 | + "--buildPath", "`"$buildPath`"" |
| 269 | + ) |
| 270 | + |
| 271 | + $process = Start-Process -FilePath $unityPath ` |
| 272 | + -ArgumentList $arguments ` |
| 273 | + -Wait -PassThru -NoNewWindow |
| 274 | + |
| 275 | + $buildExitCode = $process.ExitCode |
| 276 | + Write-Output "Finished at: $(Get-Date -Format 'HH:mm:ss') (exit code: $buildExitCode)" |
| 277 | + |
| 278 | + # Verify build output |
| 279 | + Start-Sleep -Seconds 2 |
| 280 | + if (Test-Path $buildPath) { |
| 281 | + $fileSize = (Get-Item $buildPath).Length / 1MB |
| 282 | + Write-Output "✅ Build succeeded! ($([math]::Round($fileSize, 2)) MB)" |
| 283 | + } else { |
| 284 | + Write-Output "❌ Build failed! Executable not found" |
| 285 | + Write-Output "" |
| 286 | + Write-Output "Build log:" |
| 287 | + if (Test-Path $logFile) { |
| 288 | + Get-Content $logFile |
| 289 | + } else { |
| 290 | + Write-Output "⚠️ Log file not found at: $logFile" |
| 291 | + } |
| 292 | + exit 1 |
| 293 | + } |
| 294 | + - uses: actions/setup-python@v4 |
| 295 | + with: |
| 296 | + python-version: "3.13" |
| 297 | + - name: Verify test files are accessible |
| 298 | + run: | |
| 299 | + if (-not (Test-Path "sample-unity6/Tests/requirements-desktop.txt") -and -not (Test-Path "sample/Tests/requirements-desktop.txt")) { |
| 300 | + Write-Output "❌ Test requirements file not found" |
| 301 | + exit 1 |
| 302 | + } |
| 303 | + - name: Install dependencies |
| 304 | + run: | |
| 305 | + if (Test-Path "sample-unity6/Tests/requirements-desktop.txt") { |
| 306 | + pip install -r sample-unity6/Tests/requirements-desktop.txt |
| 307 | + } else { |
| 308 | + pip install -r sample/Tests/requirements-desktop.txt |
| 309 | + } |
| 310 | + - name: Run UI tests |
| 311 | + env: |
| 312 | + UNITY_APP_PATH: Sample Unity 6 Windows.exe |
| 313 | + UNITY_APP_NAME: Sample Unity 6 Windows |
| 314 | + MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }} |
| 315 | + BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} |
| 316 | + BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} |
| 317 | + working-directory: sample-unity6/Tests |
| 318 | + run: python -m pytest -xs test/test_windows.py::WindowsTest |
| 319 | + - name: Upload build log |
| 320 | + if: always() |
| 321 | + uses: actions/upload-artifact@v4 |
| 322 | + with: |
| 323 | + name: Unity6-Windows-Build-Log |
175 | 324 | path: sample-unity6/build-log.log |
176 | 325 |
|
177 | 326 | test: |
|
0 commit comments