Skip to content

Commit 3c6d10d

Browse files
committed
chore: unity 6 sample app for windows
1 parent 5be07e2 commit 3c6d10d

File tree

17 files changed

+1281
-34
lines changed

17 files changed

+1281
-34
lines changed

.github/workflows/test-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ jobs:
132132
targetPlatform:
133133
- iOS
134134
- Android
135+
- StandaloneWindows64
135136
steps:
136137
- uses: actions/checkout@v4
137138
with:

.github/workflows/ui-tests.yml

Lines changed: 76 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ on:
1313
- All
1414
- StandaloneOSX # Builds Unity 2021 macOS only
1515
- StandaloneOSX-Unity6 # Builds Unity 6 macOS only
16-
- StandaloneWindows64
16+
- StandaloneWindows64 # Builds Unity 2021 Windows only
17+
- StandaloneWindows64-Unity6 # Builds Unity 6 Windows only
1718
# - Android
1819
# - iOS
1920
push:
@@ -88,8 +89,8 @@ jobs:
8889
name: Build & Test Unity 6 macOS 🛠️🧪
8990
runs-on: [self-hosted, macOS]
9091
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
9394
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneOSX-Unity6'
9495
steps:
9596
- name: Cleanup old builds
@@ -171,7 +172,78 @@ jobs:
171172
if: always()
172173
uses: actions/upload-artifact@v4
173174
with:
174-
name: Unity6-Build-Log
175+
name: Unity6-macOS-Build-Log
176+
path: sample-unity6/build-log.log
177+
178+
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.
179+
name: Build & Test Unity 6 Windows 🛠️🧪
180+
runs-on: [self-hosted, windows]
181+
concurrency:
182+
group: ui-tests-email-inbox-windows-unity6
183+
cancel-in-progress: false # Let tests complete rather than cancelling
184+
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneWindows64-Unity6'
185+
steps:
186+
- name: Cleanup old builds
187+
run: |
188+
# Remove previous build to save space
189+
if (Test-Path "sample-unity6/Tests") { Remove-Item -Recurse -Force "sample-unity6/Tests" -ErrorAction SilentlyContinue }
190+
- uses: actions/checkout@v3
191+
with:
192+
lfs: true
193+
- name: Setup symlinks for Unity 6 Windows
194+
run: |
195+
# Run the symlink setup script as it might not work automatically on Windows
196+
.\setup-symlinks.ps1
197+
- name: Force clean package resolution
198+
run: |
199+
Write-Output "Removing Library folder to force clean package resolution..."
200+
if (Test-Path "sample-unity6/Library") { Remove-Item -Recurse -Force "sample-unity6/Library" }
201+
Write-Output "✅ Library folder removed"
202+
- name: First build (resolves packages)
203+
run: |
204+
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"
207+
208+
Write-Output "First build completed (may have failed, that's ok). Checking for AltTester..."
209+
if (Test-Path "${{ github.workspace }}\sample-unity6\Library\PackageCache\*alttester*") {
210+
Write-Output "✅ AltTester found in PackageCache after first build"
211+
} else {
212+
Write-Output "⚠️ AltTester not found yet, but will be ready for second build"
213+
}
214+
- name: Build Unity 6 Windows with command line (second build with packages ready)
215+
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"
219+
220+
Write-Output "Build completed. Checking for build output..."
221+
Get-ChildItem sample-unity6/Tests/
222+
- uses: actions/setup-python@v4
223+
with:
224+
python-version: "3.13"
225+
- name: Install dependencies
226+
run: pip install -r sample-unity6/Tests/requirements-desktop.txt
227+
- name: Run UI tests
228+
env:
229+
UNITY_APP_PATH: Sample Unity 6 Windows.exe
230+
UNITY_APP_NAME: Sample Unity 6 Windows
231+
MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }}
232+
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
233+
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
234+
working-directory: sample-unity6/Tests
235+
run: python -m pytest -xs test/test_windows.py::WindowsTest
236+
- name: Upload first build log
237+
if: always()
238+
uses: actions/upload-artifact@v4
239+
with:
240+
name: Unity6-Windows-First-Build-Log
241+
path: sample-unity6/first-build-log.txt
242+
- name: Upload build log
243+
if: always()
244+
uses: actions/upload-artifact@v4
245+
with:
246+
name: Unity6-Windows-Build-Log
175247
path: sample-unity6/build-log.log
176248

177249
test:

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The Immutable SDK for Unity helps you integrate your game with Immutable Passpor
2222
This repository contains two sample projects:
2323

2424
- **`sample/`** - Unity 2021.3.26f1 sample project
25-
- **`sample-unity6/`** - Unity 6 sample project *(work in progress)*
25+
- **`sample-unity6/`** - Unity 6 sample project
2626

2727
Both projects share the same Scenes, Scripts, Editor folders, and Tests via symbolic links, providing a single source of truth for the sample code. See [`sample-unity6/README.md`](sample-unity6/README.md) for setup instructions.
2828

@@ -36,13 +36,14 @@ The `sample-unity6` project uses symbolic links to share Scenes, Scripts, Editor
3636
1. Navigate to `sample-unity6/Assets/` and `sample-unity6/`
3737
2. Check if `Scenes`, `Scripts`, `Editor`, and `Tests` are folders (symlinks work) or small text files (symlinks didn't work)
3838

39-
If symlinks didn't work, run the setup script:
39+
If symlinks didn't work, run the setup script as Administrator:
4040

4141
```powershell
42+
# Right-click PowerShell -> "Run as Administrator"
4243
.\setup-symlinks.ps1
4344
```
4445

45-
> **Note for Windows users**: You'll need Developer Mode enabled or run PowerShell as Administrator. See [`sample-unity6/README.md`](sample-unity6/README.md) for details.
46+
> **Note for Windows users**: You must run PowerShell as Administrator. Directory symbolic links (required for Unity to recognise the folders) need admin privileges on Windows. See [`sample-unity6/README.md`](sample-unity6/README.md) for details.
4647
4748
## Contributing
4849

sample-unity6/Assets/Editor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../sample/Assets/Editor
1+
C:/Users/natalie/Development/unity-immutable-sdk/sample/Assets/Editor

sample-unity6/Assets/Editor.meta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../sample/Assets/Editor.meta
1+
C:/Users/natalie/Development/unity-immutable-sdk/sample/Assets/Editor.meta

sample-unity6/Assets/Scenes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../sample/Assets/Scenes
1+
C:/Users/natalie/Development/unity-immutable-sdk/sample/Assets/Scenes

sample-unity6/Assets/Scenes.meta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../sample/Assets/Scenes.meta
1+
C:/Users/natalie/Development/unity-immutable-sdk/sample/Assets/Scenes.meta

sample-unity6/Assets/Scripts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../sample/Assets/Scripts
1+
C:/Users/natalie/Development/unity-immutable-sdk/sample/Assets/Scripts

sample-unity6/Assets/Scripts.meta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../../sample/Assets/Scripts.meta
1+
C:/Users/natalie/Development/unity-immutable-sdk/sample/Assets/Scripts.meta

0 commit comments

Comments
 (0)