Skip to content

Commit 2edde0f

Browse files
committed
ci: check if unity 6 sample app is built
1 parent f807e30 commit 2edde0f

File tree

2 files changed

+97
-9
lines changed

2 files changed

+97
-9
lines changed

.github/workflows/test-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ concurrency:
1313
jobs:
1414
test:
1515
if: github.event.pull_request.head.repo.fork == false
16-
name: Build sample app 🛠️
16+
name: Test sample app 🛠️
1717
runs-on: ubuntu-latest-8-cores
1818

1919
steps:

.github/workflows/ui-tests.yml

Lines changed: 96 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,30 @@ jobs:
194194
lfs: true
195195
- name: Setup symlinks for Unity 6 Windows
196196
run: .\setup-symlinks.ps1
197+
- name: Verify symlinks were created
198+
run: |
199+
Write-Output "Verifying symlinks..."
200+
Write-Output "Checking Editor folder:"
201+
if (Test-Path "sample-unity6/Assets/Editor") {
202+
Write-Output "✅ Editor folder exists"
203+
if ((Get-Item "sample-unity6/Assets/Editor").LinkType -eq "Junction") {
204+
Write-Output "✅ Editor is a symlink"
205+
Write-Output "Target: $((Get-Item 'sample-unity6/Assets/Editor').Target)"
206+
}
207+
Write-Output "Editor contents:"
208+
Get-ChildItem "sample-unity6/Assets/Editor" | Select-Object -First 10 Name
209+
Write-Output ""
210+
Write-Output "Looking for WindowsBuilderUnity6.cs:"
211+
if (Test-Path "sample-unity6/Assets/Editor/WindowsBuilderUnity6.cs") {
212+
Write-Output "✅ WindowsBuilderUnity6.cs found"
213+
} else {
214+
Write-Output "❌ WindowsBuilderUnity6.cs NOT found"
215+
exit 1
216+
}
217+
} else {
218+
Write-Output "❌ Editor folder does not exist"
219+
exit 1
220+
}
197221
- name: Force clean package resolution
198222
run: |
199223
Write-Output "Removing Library folder to force clean package resolution..."
@@ -202,23 +226,87 @@ jobs:
202226
- name: First build (resolves packages)
203227
run: |
204228
Write-Output "Running first build to trigger package resolution..."
205-
if (-not (Test-Path "sample-unity6/Tests")) { New-Item -ItemType Directory -Path "sample-unity6/Tests" }
206-
& "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\first-build-log.txt" -quit -batchmode --buildPath "${{ github.workspace }}\sample-unity6\Tests\Sample Unity 6 Windows.exe"
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") {
232+
$item = Get-Item "sample-unity6/Tests"
233+
if ($item.LinkType) {
234+
Write-Output "✅ Tests is a symlink to: $($item.Target)"
235+
} else {
236+
Write-Output "⚠️ Tests exists but is not a symlink"
237+
}
238+
} else {
239+
Write-Output "⚠️ Tests symlink not found, creating directory"
240+
New-Item -ItemType Directory -Path "sample-unity6/Tests"
241+
}
207242
208-
Write-Output "First build completed (may have failed, that's ok). Checking for AltTester..."
243+
Write-Output ""
244+
Write-Output "Unity command: C:\Program Files\Unity\Hub\Editor\6000.0.58f2\Editor\Unity.exe"
245+
Write-Output "Project path: ${{ github.workspace }}\sample-unity6"
246+
Write-Output "Build method: WindowsBuilderUnity6.BuildForAltTester"
247+
Write-Output "Build path: ${{ github.workspace }}\sample-unity6\Tests\Sample Unity 6 Windows.exe"
248+
Write-Output ""
249+
250+
& "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\first-build-log.txt" -quit -batchmode -nographics --buildPath "${{ github.workspace }}\sample-unity6\Tests\Sample Unity 6 Windows.exe"
251+
$buildExitCode = $LASTEXITCODE
252+
253+
Write-Output ""
254+
Write-Output "First build completed with exit code: $buildExitCode"
255+
Write-Output "Checking for AltTester..."
209256
if (Test-Path "${{ github.workspace }}\sample-unity6\Library\PackageCache\*alttester*") {
210257
Write-Output "✅ AltTester found in PackageCache after first build"
211258
} else {
212259
Write-Output "⚠️ AltTester not found yet, but will be ready for second build"
213260
}
261+
262+
Write-Output ""
263+
Write-Output "First build log (last 50 lines):"
264+
if (Test-Path "${{ github.workspace }}\sample-unity6\first-build-log.txt") {
265+
Get-Content "${{ github.workspace }}\sample-unity6\first-build-log.txt" -Tail 50
266+
} else {
267+
Write-Output "⚠️ Log file not found"
268+
}
214269
- name: Build Unity 6 Windows with command line (second build with packages ready)
215270
run: |
216-
Write-Output "Building Unity 6 Windows using command line..."
217-
if (-not (Test-Path "sample-unity6/Tests")) { New-Item -ItemType Directory -Path "sample-unity6/Tests" }
218-
& "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 --buildPath "${{ github.workspace }}\sample-unity6\Tests\Sample Unity 6 Windows.exe"
271+
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+
278+
Write-Output "Starting Unity build..."
279+
& "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"
280+
$buildExitCode = $LASTEXITCODE
219281
220-
Write-Output "Build completed. Checking for build output..."
221-
Get-ChildItem sample-unity6/Tests/
282+
Write-Output ""
283+
Write-Output "Build completed with exit code: $buildExitCode"
284+
Write-Output ""
285+
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
288+
} else {
289+
Write-Output "⚠️ Log file not found at: ${{ github.workspace }}\sample-unity6\build-log.log"
290+
}
291+
292+
Write-Output ""
293+
Write-Output "Checking for build output..."
294+
Get-ChildItem sample-unity6/Tests/ -ErrorAction SilentlyContinue
295+
296+
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"
303+
Write-Output ""
304+
Write-Output "Full build log:"
305+
if (Test-Path "${{ github.workspace }}\sample-unity6\build-log.log") {
306+
Get-Content "${{ github.workspace }}\sample-unity6\build-log.log"
307+
}
308+
exit 1
309+
}
222310
- uses: actions/setup-python@v4
223311
with:
224312
python-version: "3.13"

0 commit comments

Comments
 (0)