-
Notifications
You must be signed in to change notification settings - Fork 16
550 lines (520 loc) · 25.8 KB
/
ui-tests.yml
File metadata and controls
550 lines (520 loc) · 25.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
---
name: UI Tests 🧪
on:
workflow_dispatch:
inputs:
targetPlatform:
description: "Select the platform to build and test"
required: true
default: "All"
type: choice
options:
- All
- StandaloneOSX # Builds Unity 2021 macOS only
- StandaloneOSX-Unity6 # Builds Unity 6 macOS only
- StandaloneWindows64 # Builds Unity 2021 Windows only
- StandaloneWindows64-Unity6 # Builds Unity 6 Windows only
# - Android
# - iOS
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build ${{ matrix.targetPlatform }} for AltTester 🛠️
runs-on: ubuntu-latest-8-cores
strategy:
fail-fast: false
matrix:
include:
- targetPlatform: StandaloneOSX
buildMethod: MacBuilder.BuildForAltTester
buildPath: sample/Builds/MacOS
projectPath: sample
unityVersion: 2021.3.26f1
- targetPlatform: StandaloneWindows64
buildMethod: WindowsBuilder.BuildForAltTester
buildPath: sample/Builds/Windows64
projectPath: sample
unityVersion: 2021.3.26f1
# - targetPlatform: Android
# buildMethod: MobileBuilder.BuildForAltTester
# buildPath: sample/Builds/Android
# projectPath: sample
# unityVersion: 2021.3.26f1
steps:
- uses: actions/checkout@v3
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
with:
lfs: true
- uses: actions/cache@v3
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
with:
path: Library
key: Library-${{ matrix.targetPlatform }}-${{ hashFiles(format('{0}/Assets/**', matrix.projectPath), format('{0}/Packages/**', matrix.projectPath), format('{0}/ProjectSettings/**', matrix.projectPath)) }}
restore-keys: |
Library-${{ matrix.targetPlatform }}
Library-
- name: Build project
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
uses: game-ci/unity-builder@v4
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
targetPlatform: ${{ contains(matrix.targetPlatform, 'Unity6') && 'StandaloneOSX' || matrix.targetPlatform }}
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
buildMethod: ${{ matrix.buildMethod }}
customParameters: -logFile logFile.log -quit -batchmode
artifactsPath: ${{ matrix.buildPath }}
- name: Ensure build path exists
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
run: mkdir -p ${{ matrix.buildPath }}
- name: Upload artifact
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
uses: actions/upload-artifact@v4
with:
name: Build-${{ matrix.targetPlatform }}
path: ${{ matrix.buildPath }}
build-and-test-unity6-macos: # 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.
name: Build & Test Unity 6 macOS 🛠️🧪
runs-on: [self-hosted, macOS]
concurrency:
group: ui-tests-email-inbox-macos-unity6
cancel-in-progress: false # Let tests complete rather than cancelling
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneOSX-Unity6'
steps:
- name: Cleanup old builds
run: |
# Remove previous build to save space
rm -rf sample-unity6/Tests/* 2>/dev/null || true
- uses: actions/checkout@v3
with:
lfs: true
- name: Setup symlinks for Unity 6 macOS
run: ./setup-symlinks.sh
- name: Force clean package resolution
run: |
echo "Removing Library folder to force clean package resolution..."
rm -rf sample-unity6/Library
echo "✅ Library folder removed"
- name: First build (resolves packages)
run: |
echo "Running first build to trigger package resolution..."
export TMPDIR="/Users/svc_buildsdk/tmp"
mkdir -p "$TMPDIR"
mkdir -p sample-unity6/Tests
/Applications/Unity/Hub/Editor/6000.0.58f2/Unity.app/Contents/MacOS/Unity -projectPath "${{ github.workspace }}/sample-unity6" -executeMethod "MacBuilderUnity6.BuildForAltTester" -logFile "${{ github.workspace }}/sample-unity6/first-build-log.txt" -quit -batchmode --buildPath "${{ github.workspace }}/sample-unity6/Tests/Sample Unity 6 macOS" || true
echo "First build completed (may have failed, that's ok). Checking for AltTester..."
if ls -la "${{ github.workspace }}/sample-unity6/Library/PackageCache/" | grep alttester; then
echo "✅ AltTester found in PackageCache after first build"
else
echo "⚠️ AltTester not found yet, but will be ready for second build"
fi
- name: Build Unity 6 macOS with command line (second build with packages ready)
run: |
echo "Building Unity 6 macOS using command line..."
export TMPDIR="/Users/svc_buildsdk/tmp"
mkdir -p "$TMPDIR"
mkdir -p sample-unity6/Tests
/Applications/Unity/Hub/Editor/6000.0.58f2/Unity.app/Contents/MacOS/Unity -projectPath "${{ github.workspace }}/sample-unity6" -executeMethod "MacBuilderUnity6.BuildForAltTester" -logFile "${{ github.workspace }}/sample-unity6/build-log.log" -quit -batchmode --buildPath "${{ github.workspace }}/sample-unity6/Tests/Sample Unity 6 macOS"
echo "Build completed. Checking for build output..."
ls -la sample-unity6/Tests/
- name: Create temporary keychain
run: |
security list-keychains
security delete-keychain temporary || true
security list-keychains
security create-keychain -p "" temporary
security default-keychain -s temporary
security unlock-keychain -p "" temporary
security set-keychain-settings -lut 600 temporary
- name: Make macOS artifact executable
run: chmod -R +x 'sample-unity6/Tests/Sample Unity 6 macOS.app/Contents/MacOS'
- uses: actions/setup-python@v4
with:
python-version: "3.13"
- name: Install dependencies
run: pip install -r sample-unity6/Tests/requirements-desktop.txt
- name: Run UI tests
env:
UNITY_APP_PATH: Sample Unity 6 macOS.app
UNITY_APP_NAME: Sample Unity 6 macOS
MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }}
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
working-directory: sample-unity6/Tests
run: pytest -xs test/test_mac.py::MacTest
- name: Collect Unity Player logs (macOS)
if: always()
run: |
set -euo pipefail
workspaceLogs="${{ github.workspace }}/sample-unity6/player-logs"
zipPath="${{ github.workspace }}/sample-unity6/Unity6-macOS-PlayerLogs.zip"
mkdir -p "$workspaceLogs"
# Unity Editor logs (useful for build/package debugging)
unityLogsDir="$HOME/Library/Logs/Unity"
if [ -d "$unityLogsDir" ]; then
cp -R "$unityLogsDir" "$workspaceLogs/UnityLogs" || true
echo "Copied Unity logs from: $unityLogsDir"
else
echo "Unity logs directory not found: $unityLogsDir"
fi
# Unity Player logs (the standalone app's Player.log). This is what we actually
# need when UI tests fail at runtime. On macOS it's typically under:
# ~/Library/Logs/<CompanyName>/<ProductName>/Player.log
python3 - <<'PY'
import os
import shutil
from pathlib import Path
home = Path.home()
logs_root = home / "Library" / "Logs"
workspace = Path(os.environ.get("GITHUB_WORKSPACE", "."))
dest_dir = workspace / "sample-unity6" / "player-logs" / "PlayerLogs"
dest_dir.mkdir(parents=True, exist_ok=True)
candidates = []
if logs_root.exists():
# Prefer company folders we expect, but fall back to scanning all Logs.
preferred_roots = [
logs_root / "Immutable",
logs_root / "unity3d",
logs_root,
]
for root in preferred_roots:
if root.exists():
candidates.extend(root.rglob("Player.log"))
copied = 0
for plog in candidates:
try:
rel = plog.relative_to(logs_root)
out_name = str(rel).replace("/", "__")
except Exception:
out_name = plog.name
out_path = dest_dir / out_name
try:
shutil.copy2(plog, out_path)
copied += 1
except Exception:
pass
print(f"Collected {copied} Player.log file(s) into: {dest_dir}")
PY
# Try to collect crash reports (if any)
diagDir="$HOME/Library/Logs/DiagnosticReports"
if [ -d "$diagDir" ]; then
mkdir -p "$workspaceLogs/DiagnosticReports"
cp -R "$diagDir/"*Sample*Unity*6*macOS* "$workspaceLogs/DiagnosticReports/" 2>/dev/null || true
cp -R "$diagDir/"*Unity* "$workspaceLogs/DiagnosticReports/" 2>/dev/null || true
echo "Attempted to copy DiagnosticReports from: $diagDir"
else
echo "DiagnosticReports directory not found: $diagDir"
fi
rm -f "$zipPath" || true
(cd "${{ github.workspace }}/sample-unity6" && zip -r "Unity6-macOS-PlayerLogs.zip" "player-logs" >/dev/null) || true
echo "Player logs zip created: $zipPath"
- name: Upload Unity Player logs (macOS)
if: always()
uses: actions/upload-artifact@v4
with:
name: Unity6-macOS-Player-Logs
path: sample-unity6/Unity6-macOS-PlayerLogs.zip
- name: Remove temporary keychain
if: always()
run: |
security list-keychains
security delete-keychain temporary
security default-keychain -s ~/Library/Keychains/login.keychain-db
security list-keychains -d user -s ~/Library/Keychains/login.keychain-db
security list-keychains
- name: Upload first build log
if: always()
uses: actions/upload-artifact@v4
with:
name: Unity6-First-Build-Log
path: sample-unity6/first-build-log.txt
- name: Upload build log
if: always()
uses: actions/upload-artifact@v4
with:
name: Unity6-macOS-Build-Log
path: sample-unity6/build-log.log
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.
name: Build & Test Unity 6 Windows 🛠️🧪
runs-on: [self-hosted, windows]
concurrency:
group: ui-tests-email-inbox-windows-unity6
cancel-in-progress: false # Let tests complete rather than cancelling
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneWindows64-Unity6'
steps:
- name: Cleanup old builds
run: |
# Remove previous build to save space
if (Test-Path "sample-unity6/Tests") { Remove-Item -Recurse -Force "sample-unity6/Tests" -ErrorAction SilentlyContinue }
- uses: actions/checkout@v3
with:
lfs: true
- name: Cache Unity Library folder
uses: actions/cache@v3
with:
path: sample-unity6/Library
key: Library-Unity6-Windows-${{ hashFiles('sample-unity6/Assets/**', 'sample-unity6/Packages/**', 'sample-unity6/ProjectSettings/**') }}
restore-keys: |
Library-Unity6-Windows-
- name: Setup symlinks for Unity 6 Windows
run: .\setup-symlinks.ps1
- name: Verify symlinks were created
run: |
if (-not (Test-Path "sample-unity6/Assets/Editor/WindowsBuilderUnity6.cs")) {
Write-Output "❌ Build script not found - symlink setup failed"
exit 1
}
Write-Output "✅ Symlinks verified"
# Don't delete Library folder - let Unity reuse cached package data if available
# Deleting it forces a complete reimport which takes too long
- name: Ensure Tests directory exists
run: |
if (-not (Test-Path "sample-unity6/Tests")) {
New-Item -ItemType Directory -Path "sample-unity6/Tests" -Force | Out-Null
}
- name: First build (resolves packages)
run: |
Write-Output "Running first build to trigger package resolution..."
$unityPath = "C:\Program Files\Unity\Hub\Editor\6000.0.58f2\Editor\Unity.exe"
$projectPath = "${{ github.workspace }}\sample-unity6"
$logFile = "${{ github.workspace }}\sample-unity6\first-build-log.txt"
$buildPath = "${{ github.workspace }}\sample-unity6\Tests\Sample Unity 6 Windows.exe"
$arguments = @(
"-projectPath", "`"$projectPath`"",
"-executeMethod", "WindowsBuilderUnity6.BuildForAltTester",
"-logFile", "`"$logFile`"",
"-quit", "-batchmode", "-nographics",
"--buildPath", "`"$buildPath`""
)
# Run and ignore exit code (may fail on first attempt)
$process = Start-Process -FilePath $unityPath `
-ArgumentList $arguments `
-Wait -PassThru -NoNewWindow
Write-Output "First build completed (exit code: $($process.ExitCode), may have failed, that's ok). Checking for AltTester..."
if (Test-Path "${{ github.workspace }}\sample-unity6\Library\PackageCache") {
$altTesterFound = Get-ChildItem "${{ github.workspace }}\sample-unity6\Library\PackageCache" -Filter "*alttester*" -ErrorAction SilentlyContinue
if ($altTesterFound) {
Write-Output "✅ AltTester found in PackageCache after first build"
} else {
Write-Output "⚠️ AltTester not found yet, but will be ready for second build"
}
}
- name: Build Unity 6 Windows executable
timeout-minutes: 20
run: |
Write-Output "Building Unity 6 Windows executable..."
Write-Output "Started at: $(Get-Date -Format 'HH:mm:ss')"
# Run Unity build
$unityPath = "C:\Program Files\Unity\Hub\Editor\6000.0.58f2\Editor\Unity.exe"
$projectPath = "${{ github.workspace }}\sample-unity6"
$logFile = "${{ github.workspace }}\sample-unity6\build-log.log"
$buildPath = "${{ github.workspace }}\sample-unity6\Tests\Sample Unity 6 Windows.exe"
# Build argument list with proper quoting for paths with spaces
$arguments = @(
"-projectPath", "`"$projectPath`"",
"-executeMethod", "WindowsBuilderUnity6.BuildForAltTester",
"-logFile", "`"$logFile`"",
"-quit", "-batchmode", "-nographics",
"--buildPath", "`"$buildPath`""
)
$process = Start-Process -FilePath $unityPath `
-ArgumentList $arguments `
-Wait -PassThru -NoNewWindow
$buildExitCode = $process.ExitCode
Write-Output "Finished at: $(Get-Date -Format 'HH:mm:ss') (exit code: $buildExitCode)"
# Verify build output
Start-Sleep -Seconds 2
if (Test-Path $buildPath) {
$fileSize = (Get-Item $buildPath).Length / 1MB
Write-Output "✅ Build succeeded! ($([math]::Round($fileSize, 2)) MB)"
} else {
Write-Output "❌ Build failed! Executable not found"
Write-Output ""
Write-Output "Build log:"
if (Test-Path $logFile) {
Get-Content $logFile
} else {
Write-Output "⚠️ Log file not found at: $logFile"
}
exit 1
}
- uses: actions/setup-python@v4
with:
python-version: "3.13"
- name: Verify test files are accessible
run: |
if (-not (Test-Path "sample-unity6/Tests/requirements-desktop.txt") -and -not (Test-Path "sample/Tests/requirements-desktop.txt")) {
Write-Output "❌ Test requirements file not found"
exit 1
}
- name: Install dependencies
run: |
if (Test-Path "sample-unity6/Tests/requirements-desktop.txt") {
pip install -r sample-unity6/Tests/requirements-desktop.txt
} else {
pip install -r sample/Tests/requirements-desktop.txt
}
- name: Run UI tests
env:
UNITY_APP_PATH: Sample Unity 6 Windows.exe
UNITY_APP_NAME: Sample Unity 6 Windows
MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }}
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
working-directory: sample-unity6/Tests
run: python -m pytest -xs test/test_windows.py::WindowsTest
- name: Collect Unity Player logs (Windows)
if: always()
run: |
$playerLogRoot = Join-Path $env:USERPROFILE "AppData\LocalLow\Immutable\Sample Unity 6 Windows"
$workspaceLogs = "${{ github.workspace }}\sample-unity6\player-logs"
$zipPath = "${{ github.workspace }}\sample-unity6\Unity6-Windows-PlayerLogs.zip"
New-Item -ItemType Directory -Force -Path $workspaceLogs | Out-Null
if (Test-Path $playerLogRoot) {
Copy-Item -Force -Recurse "$playerLogRoot\*" $workspaceLogs -ErrorAction SilentlyContinue
Write-Output "Copied player logs from: $playerLogRoot"
} else {
Write-Output "Player log directory not found: $playerLogRoot"
}
# Also try to capture Unity crash dumps if present
$unityCrashes = Join-Path $env:USERPROFILE "AppData\LocalLow\Unity\Crashes"
if (Test-Path $unityCrashes) {
$crashDst = Join-Path $workspaceLogs "UnityCrashes"
New-Item -ItemType Directory -Force -Path $crashDst | Out-Null
Copy-Item -Force -Recurse "$unityCrashes\*" $crashDst -ErrorAction SilentlyContinue
Write-Output "Copied Unity crashes from: $unityCrashes"
} else {
Write-Output "Unity crashes directory not found: $unityCrashes"
}
if (Test-Path $zipPath) { Remove-Item -Force $zipPath }
Compress-Archive -Path "$workspaceLogs\*" -DestinationPath $zipPath -Force
Write-Output "Player logs zip created: $zipPath"
- name: Upload Unity Player logs (Windows)
if: always()
uses: actions/upload-artifact@v4
with:
name: Unity6-Windows-Player-Logs
path: sample-unity6/Unity6-Windows-PlayerLogs.zip
- name: Upload build log
if: always()
uses: actions/upload-artifact@v4
with:
name: Unity6-Windows-Build-Log
path: sample-unity6/build-log.log
test:
name: Run ${{ matrix.targetPlatform }} UI tests 🧪
needs: build
strategy:
matrix:
include:
- targetPlatform: StandaloneOSX
runs-on: [self-hosted, macOS]
test_script: pytest -xs test/test_mac.py::MacTest
projectPath: sample
unityAppName: SampleApp
unityAppExtension: .app
concurrency_group: macos
- targetPlatform: StandaloneWindows64
runs-on: [self-hosted, windows]
test_script: python -m pytest -xs test/test_windows.py::WindowsTest
projectPath: sample
unityAppName: Immutable Sample
unityAppExtension: .exe
concurrency_group: windows
# - targetPlatform: Android
# runs-on: [ self-hosted, macOS ]
# test_script: browserstack-sdk pytest -s ./test/test_android.py --browserstack.config "browserstack.android.yml"
concurrency:
group: ui-tests-email-inbox-${{ matrix.concurrency_group }}
cancel-in-progress: false # Let tests complete rather than canceling
runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v3
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
with:
lfs: true
- name: Create temporary keychain
if: contains(matrix.targetPlatform, 'StandaloneOSX') && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform)
run: |
security list-keychains
security delete-keychain temporary || true
security list-keychains
security create-keychain -p "" temporary
security default-keychain -s temporary
security unlock-keychain -p "" temporary
security set-keychain-settings -lut 600 temporary
- uses: actions/download-artifact@v4
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
with:
name: Build-${{ matrix.targetPlatform }}
path: ${{ matrix.projectPath }}/Tests
- name: Make macOS artifact executable
if: |
contains(matrix.targetPlatform, 'StandaloneOSX') &&
(github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform)
run: chmod -R +x '${{ matrix.projectPath }}/Tests/${{ matrix.unityAppName }}.app/Contents/MacOS'
- uses: actions/setup-python@v4
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
with:
python-version: "3.13"
- name: Install dependencies (Windows)
if: matrix.targetPlatform == 'StandaloneWindows64' && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneWindows64')
run: pip install -r "${{ matrix.projectPath }}/Tests/requirements-desktop.txt"
- name: Install dependencies (Mac)
if: contains(matrix.targetPlatform, 'StandaloneOSX') && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform)
run: pip install -r "${{ matrix.projectPath }}/Tests/requirements-desktop.txt"
- name: Run UI tests
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
env:
UNITY_APP_PATH: ${{ matrix.unityAppName }}${{ matrix.unityAppExtension }}
UNITY_APP_NAME: ${{ matrix.unityAppName }}
MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }}
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
working-directory: ${{ matrix.projectPath }}/Tests
run: ${{ matrix.test_script }}
- name: Remove temporary keychain
if: contains(matrix.targetPlatform, 'StandaloneOSX') && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform)
run: |
security list-keychains
security delete-keychain temporary
security default-keychain -s ~/Library/Keychains/login.keychain-db
security list-keychains -d user -s ~/Library/Keychains/login.keychain-db
security list-keychains
# build-ios: #test-ios:
# name: Run iOS build #UI tests 🧪
# needs:
# - build
# - test
# runs-on: [ self-hosted, macOS ]
# if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'iOS'
# steps:
# - uses: actions/checkout@v3
# with:
# lfs: true
# - name: Build iOS app
# working-directory: sample
# run: |
# export TMPDIR=/Users/svc_buildsdk/tmp
# mkdir -p $TMPDIR
# ./build_ios.sh
# - uses: actions/setup-python@v4
# with:
# python-version: "3.13"
# - name: Install dependencies
# run: pip install -r "sample/Tests/requirements-mobile.txt"
# - name: Run UI tests
# env:
# MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }}
# BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
# BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
# working-directory: sample/Tests/test/ios
# run: browserstack-sdk pytest -xs ./test_ios.py --browserstack.config "browserstack.ios.yml"