@@ -223,24 +223,23 @@ jobs:
223223 Write-Output "Removing Library folder to force clean package resolution..."
224224 if (Test-Path "sample-unity6/Library") { Remove-Item -Recurse -Force "sample-unity6/Library" }
225225 Write-Output "✅ Library folder removed"
226- - name : First build (resolves packages)
226+ - name : Ensure Tests directory exists
227227 run : |
228- Write-Output "Running first build to trigger package resolution..."
229- # Don't create Tests directory - it should be a symlink from setup-symlinks.ps1
230- # Verify the symlink exists
231- if (Test-Path "sample-unity6/Tests") {
228+ Write-Output "Ensuring Tests directory/symlink exists..."
229+ if (-not (Test-Path "sample-unity6/Tests")) {
230+ Write-Output "Creating Tests directory..."
231+ New-Item -ItemType Directory -Path "sample-unity6/Tests" -Force
232+ } else {
232233 $item = Get-Item "sample-unity6/Tests"
233234 if ($item.LinkType) {
234235 Write-Output "✅ Tests is a symlink to: $($item.Target)"
235236 } else {
236- Write-Output "⚠️ Tests exists but is not a symlink "
237+ Write-Output "✅ Tests directory exists "
237238 }
238- } else {
239- Write-Output "⚠️ Tests symlink not found, creating directory"
240- New-Item -ItemType Directory -Path "sample-unity6/Tests"
241239 }
242-
243- Write-Output ""
240+ - name : First build (resolves packages)
241+ run : |
242+ Write-Output "Running first build to trigger package resolution..."
244243 Write-Output "Unity command: C:\Program Files\Unity\Hub\Editor\6000.0.58f2\Editor\Unity.exe"
245244 Write-Output "Project path: ${{ github.workspace }}\sample-unity6"
246245 Write-Output "Build method: WindowsBuilderUnity6.BuildForAltTester"
@@ -269,49 +268,104 @@ jobs:
269268 - name : Build Unity 6 Windows with command line (second build with packages ready)
270269 run : |
271270 Write-Output "Building Unity 6 Windows using command line (second attempt)..."
272- # Don't create Tests directory - it should already exist from first build or be a symlink
273- if (-not (Test-Path "sample-unity6/Tests")) {
274- Write-Output "⚠️ Tests directory/symlink not found, creating directory"
275- New-Item -ItemType Directory -Path "sample-unity6/Tests"
276- }
277-
278271 Write-Output "Starting Unity build..."
279272 & "C:\Program Files\Unity\Hub\Editor\6000.0.58f2\Editor\Unity.exe" -projectPath "${{ github.workspace }}\sample-unity6" -executeMethod "WindowsBuilderUnity6.BuildForAltTester" -logFile "${{ github.workspace }}\sample-unity6\build-log.log" -quit -batchmode -nographics --buildPath "${{ github.workspace }}\sample-unity6\Tests\Sample Unity 6 Windows.exe"
280273 $buildExitCode = $LASTEXITCODE
281274
282275 Write-Output ""
283276 Write-Output "Build completed with exit code: $buildExitCode"
277+
278+ # Wait a moment for file system to settle
279+ Start-Sleep -Seconds 2
280+
284281 Write-Output ""
285282 Write-Output "Build log (last 100 lines):"
286- if (Test-Path "${{ github.workspace }}\sample-unity6\build-log.log") {
287- Get-Content "${{ github.workspace }}\sample-unity6\build-log.log" -Tail 100
283+ $logPath = "${{ github.workspace }}\sample-unity6\build-log.log"
284+ if (Test-Path $logPath) {
285+ Write-Output "Log file found at: $logPath"
286+ Get-Content $logPath -Tail 100
288287 } else {
289- Write-Output "⚠️ Log file not found at: ${{ github.workspace }}\sample-unity6\build-log.log"
288+ Write-Output "⚠️ Log file not found at: $logPath"
289+ Write-Output "Checking current directory..."
290+ if (Test-Path "sample-unity6\build-log.log") {
291+ Write-Output "Found in relative path!"
292+ Get-Content "sample-unity6\build-log.log" -Tail 100
293+ } else {
294+ Write-Output "Listing sample-unity6 directory:"
295+ Get-ChildItem "sample-unity6" -File | Where-Object { $_.Name -like "*.log" -or $_.Name -like "*.txt" } | Format-Table Name, Length, LastWriteTime
296+ }
290297 }
291298
292299 Write-Output ""
293300 Write-Output "Checking for build output..."
294301 Get-ChildItem sample-unity6/Tests/ -ErrorAction SilentlyContinue
295302
296303 Write-Output ""
297- if (Test-Path "${{ github.workspace }}\sample-unity6\Tests\Sample Unity 6 Windows.exe") {
298- Write-Output "✅ Build succeeded! Executable found at: ${{ github.workspace }}\sample-unity6\Tests\Sample Unity 6 Windows.exe"
299- $fileSize = (Get-Item "${{ github.workspace }}\sample-unity6\Tests\Sample Unity 6 Windows.exe").Length / 1MB
300- Write-Output "File size: $([math]::Round($fileSize, 2)) MB"
301- } else {
302- Write-Output "❌ Build failed! Executable not found at: ${{ github.workspace }}\sample-unity6\Tests\Sample Unity 6 Windows.exe"
304+ Write-Output "Searching for executable..."
305+ $exePaths = @(
306+ "${{ github.workspace }}\sample-unity6\Tests\Sample Unity 6 Windows.exe",
307+ "sample-unity6\Tests\Sample Unity 6 Windows.exe",
308+ "${{ github.workspace }}\sample\Tests\Sample Unity 6 Windows.exe",
309+ "sample\Tests\Sample Unity 6 Windows.exe"
310+ )
311+
312+ $exeFound = $false
313+ foreach ($path in $exePaths) {
314+ if (Test-Path $path) {
315+ Write-Output "✅ Build succeeded! Executable found at: $path"
316+ $fileSize = (Get-Item $path).Length / 1MB
317+ Write-Output "File size: $([math]::Round($fileSize, 2)) MB"
318+ $exeFound = $true
319+ break
320+ } else {
321+ Write-Output "Not found: $path"
322+ }
323+ }
324+
325+ if (-not $exeFound) {
326+ Write-Output ""
327+ Write-Output "❌ Build failed! Executable not found in any expected location"
303328 Write-Output ""
304329 Write-Output "Full build log:"
305330 if (Test-Path "${{ github.workspace }}\sample-unity6\build-log.log") {
306331 Get-Content "${{ github.workspace }}\sample-unity6\build-log.log"
332+ } elseif (Test-Path "sample-unity6\build-log.log") {
333+ Get-Content "sample-unity6\build-log.log"
334+ } else {
335+ Write-Output "⚠️ Build log not found"
307336 }
308337 exit 1
309338 }
310339 - uses : actions/setup-python@v4
311340 with :
312341 python-version : " 3.13"
342+ - name : Verify test files are accessible
343+ run : |
344+ Write-Output "Checking for test files in sample-unity6/Tests..."
345+ if (Test-Path "sample-unity6/Tests/requirements-desktop.txt") {
346+ Write-Output "✅ requirements-desktop.txt found"
347+ } else {
348+ Write-Output "⚠️ requirements-desktop.txt not found, trying sample/Tests..."
349+ if (Test-Path "sample/Tests/requirements-desktop.txt") {
350+ Write-Output "✅ Found in sample/Tests"
351+ } else {
352+ Write-Output "❌ requirements-desktop.txt not found"
353+ exit 1
354+ }
355+ }
356+ if (Test-Path "sample-unity6/Tests/test") {
357+ Write-Output "✅ test directory found"
358+ } else {
359+ Write-Output "⚠️ test directory not found in sample-unity6/Tests"
360+ }
313361 - name : Install dependencies
314- run : pip install -r sample-unity6/Tests/requirements-desktop.txt
362+ run : |
363+ if (Test-Path "sample-unity6/Tests/requirements-desktop.txt") {
364+ pip install -r sample-unity6/Tests/requirements-desktop.txt
365+ } else {
366+ Write-Output "Installing from sample/Tests instead..."
367+ pip install -r sample/Tests/requirements-desktop.txt
368+ }
315369 - name : Run UI tests
316370 env :
317371 UNITY_APP_PATH : Sample Unity 6 Windows.exe
0 commit comments