Skip to content

Commit f241600

Browse files
committed
ci: remove auto run player, unity 6 command line flags
1 parent 2edde0f commit f241600

File tree

3 files changed

+83
-29
lines changed

3 files changed

+83
-29
lines changed

.github/workflows/ui-tests.yml

Lines changed: 81 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -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

sample/Assets/Editor/MacBuilderUnity6.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private static void BuildPlayer(string defaultBuildPath, bool setupForAltTester
6464
{
6565
buildProfile = buildProfile,
6666
locationPathName = buildPath,
67-
options = setupForAltTester ? (BuildOptions.Development | BuildOptions.IncludeTestAssemblies | BuildOptions.AutoRunPlayer) : BuildOptions.None
67+
options = setupForAltTester ? (BuildOptions.Development | BuildOptions.IncludeTestAssemblies) : BuildOptions.None
6868
};
6969

7070
Debug.Log($"Build options: {options.options}");

sample/Assets/Editor/WindowsBuilderUnity6.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private static void BuildPlayer(string defaultBuildPath, bool setupForAltTester
6464
{
6565
buildProfile = buildProfile,
6666
locationPathName = buildPath,
67-
options = setupForAltTester ? (BuildOptions.Development | BuildOptions.IncludeTestAssemblies | BuildOptions.AutoRunPlayer) : BuildOptions.None
67+
options = setupForAltTester ? (BuildOptions.Development | BuildOptions.IncludeTestAssemblies) : BuildOptions.None
6868
};
6969

7070
Debug.Log($"Build options: {options.options}");

0 commit comments

Comments
 (0)