Skip to content

Commit a01fcd6

Browse files
authored
ci: unity6 mac (#594)
* ci: unity 6 mac build * ci: load unity 6 profile after alttester setup, unity 6 deeplink, symbolic links for tests * ci: build unity 6 sample app manually * ci: mac unity 6 build shared directory * ci: resolve unity 6 package synchronously * ci: use symlinks for unity 6 build * ci: concurrency group, vuplex scripting define symbol, tmp * ci: fix build name and extension
1 parent c6253c8 commit a01fcd6

File tree

192 files changed

+75459
-106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

192 files changed

+75459
-106
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
# Ensure symlinks are stored as symlinks, not as text files
44
sample-unity6/Assets/Scenes text=auto
55
sample-unity6/Assets/Scripts text=auto
6+
sample-unity6/Assets/Editor text=auto
67
sample-unity6/Assets/Scenes.meta text=auto
78
sample-unity6/Assets/Scripts.meta text=auto
9+
sample-unity6/Assets/Editor.meta text=auto
10+
sample-unity6/Tests text=auto

.github/workflows/ui-tests.yml

Lines changed: 127 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ on:
1111
type: choice
1212
options:
1313
- All
14-
- StandaloneOSX
14+
- StandaloneOSX # Builds Unity 2021 macOS only
15+
- StandaloneOSX-Unity6 # Builds Unity 6 macOS only
1516
- StandaloneWindows64
1617
- Android
1718
- iOS
@@ -31,15 +32,22 @@ jobs:
3132
fail-fast: false
3233
matrix:
3334
include:
35+
# Unity 2021 macOS build
3436
- targetPlatform: StandaloneOSX
3537
buildMethod: MacBuilder.BuildForAltTester
3638
buildPath: sample/Builds/MacOS
39+
projectPath: sample
40+
unityVersion: 2021.3.26f1
3741
- targetPlatform: StandaloneWindows64
3842
buildMethod: WindowsBuilder.BuildForAltTester
3943
buildPath: sample/Builds/Windows64
44+
projectPath: sample
45+
unityVersion: 2021.3.26f1
4046
- targetPlatform: Android
4147
buildMethod: MobileBuilder.BuildForAltTester
4248
buildPath: sample/Builds/Android
49+
projectPath: sample
50+
unityVersion: 2021.3.26f1
4351
steps:
4452
- uses: actions/checkout@v3
4553
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
@@ -49,7 +57,7 @@ jobs:
4957
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
5058
with:
5159
path: Library
52-
key: Library-${{ matrix.targetPlatform }}-${{ hashFiles('sample/Assets/**', 'sample/Packages/**', 'sample/ProjectSettings/**') }}
60+
key: Library-${{ matrix.targetPlatform }}-${{ hashFiles(format('{0}/Assets/**', matrix.projectPath), format('{0}/Packages/**', matrix.projectPath), format('{0}/ProjectSettings/**', matrix.projectPath)) }}
5361
restore-keys: |
5462
Library-${{ matrix.targetPlatform }}
5563
Library-
@@ -61,8 +69,9 @@ jobs:
6169
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
6270
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
6371
with:
64-
targetPlatform: ${{ matrix.targetPlatform }}
65-
projectPath: sample
72+
targetPlatform: ${{ contains(matrix.targetPlatform, 'Unity6') && 'StandaloneOSX' || matrix.targetPlatform }}
73+
projectPath: ${{ matrix.projectPath }}
74+
unityVersion: ${{ matrix.unityVersion }}
6675
buildMethod: ${{ matrix.buildMethod }}
6776
customParameters: -logFile logFile.log -quit -batchmode
6877
artifactsPath: ${{ matrix.buildPath }}
@@ -75,6 +84,97 @@ jobs:
7584
with:
7685
name: Build-${{ matrix.targetPlatform }}
7786
path: ${{ matrix.buildPath }}
87+
88+
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.
89+
name: Build & Test Unity 6 macOS 🛠️🧪
90+
runs-on: [self-hosted, macOS]
91+
concurrency:
92+
group: ui-tests-email-inbox-macos
93+
cancel-in-progress: false # Let tests complete rather than canceling
94+
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneOSX-Unity6'
95+
steps:
96+
- name: Cleanup old builds
97+
run: |
98+
# Remove previous build to save space
99+
rm -rf sample-unity6/Tests/* 2>/dev/null || true
100+
- uses: actions/checkout@v3
101+
with:
102+
lfs: true
103+
- name: Force clean package resolution
104+
run: |
105+
echo "Removing Library folder to force clean package resolution..."
106+
rm -rf sample-unity6/Library
107+
echo "✅ Library folder removed"
108+
- name: First build (resolves packages)
109+
run: |
110+
echo "Running first build to trigger package resolution..."
111+
export TMPDIR="/Users/svc_buildsdk/tmp"
112+
mkdir -p "$TMPDIR"
113+
mkdir -p sample-unity6/Tests
114+
/Applications/Unity/Hub/Editor/6000.0.58f1/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
115+
116+
echo "First build completed (may have failed, that's ok). Checking for AltTester..."
117+
if ls -la "${{ github.workspace }}/sample-unity6/Library/PackageCache/" | grep alttester; then
118+
echo "✅ AltTester found in PackageCache after first build"
119+
else
120+
echo "⚠️ AltTester not found yet, but will be ready for second build"
121+
fi
122+
- name: Build Unity 6 macOS with command line (second build with packages ready)
123+
run: |
124+
echo "Building Unity 6 macOS using command line..."
125+
export TMPDIR="/Users/svc_buildsdk/tmp"
126+
mkdir -p "$TMPDIR"
127+
mkdir -p sample-unity6/Tests
128+
/Applications/Unity/Hub/Editor/6000.0.58f1/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"
129+
130+
echo "Build completed. Checking for build output..."
131+
ls -la sample-unity6/Tests/
132+
- name: Create temporary keychain
133+
run: |
134+
security list-keychains
135+
security delete-keychain temporary || true
136+
security list-keychains
137+
security create-keychain -p "" temporary
138+
security default-keychain -s temporary
139+
security unlock-keychain -p "" temporary
140+
security set-keychain-settings -lut 600 temporary
141+
- name: Make macOS artifact executable
142+
run: chmod -R +x 'sample-unity6/Tests/Sample Unity 6 macOS.app/Contents/MacOS'
143+
- uses: actions/setup-python@v4
144+
with:
145+
python-version: "3.13"
146+
- name: Install dependencies
147+
run: pip install -r sample-unity6/Tests/requirements-desktop.txt
148+
- name: Run UI tests
149+
env:
150+
UNITY_APP_PATH: Sample Unity 6 macOS.app
151+
UNITY_APP_NAME: Sample Unity 6 macOS
152+
MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }}
153+
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
154+
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
155+
working-directory: sample-unity6/Tests
156+
run: pytest -xs test/test_mac.py::MacTest
157+
- name: Remove temporary keychain
158+
if: always()
159+
run: |
160+
security list-keychains
161+
security delete-keychain temporary
162+
security default-keychain -s ~/Library/Keychains/login.keychain-db
163+
security list-keychains -d user -s ~/Library/Keychains/login.keychain-db
164+
security list-keychains
165+
- name: Upload first build log
166+
if: always()
167+
uses: actions/upload-artifact@v4
168+
with:
169+
name: Unity6-First-Build-Log
170+
path: sample-unity6/first-build-log.txt
171+
- name: Upload build log
172+
if: always()
173+
uses: actions/upload-artifact@v4
174+
with:
175+
name: Unity6-Build-Log
176+
path: sample-unity6/build-log.log
177+
78178
test:
79179
name: Run ${{ matrix.targetPlatform }} UI tests 🧪
80180
needs: build
@@ -84,14 +184,22 @@ jobs:
84184
- targetPlatform: StandaloneOSX
85185
runs-on: [self-hosted, macOS]
86186
test_script: pytest -xs test/test_mac.py::MacTest
187+
projectPath: sample
188+
unityAppName: SampleApp
189+
unityAppExtension: .app
190+
concurrency_group: macos
87191
- targetPlatform: StandaloneWindows64
88192
runs-on: [self-hosted, windows]
89193
test_script: python -m pytest -xs test/test_windows.py::WindowsTest
194+
projectPath: sample
195+
unityAppName: Immutable Sample
196+
unityAppExtension: .exe
197+
concurrency_group: windows
90198
# - targetPlatform: Android
91199
# runs-on: [ self-hosted, macOS ]
92200
# test_script: browserstack-sdk pytest -s ./test/test_android.py --browserstack.config "browserstack.android.yml"
93201
concurrency:
94-
group: ui-tests-email-inbox
202+
group: ui-tests-email-inbox-${{ matrix.concurrency_group }}
95203
cancel-in-progress: false # Let tests complete rather than canceling
96204
runs-on: ${{ matrix.runs-on }}
97205
steps:
@@ -100,7 +208,7 @@ jobs:
100208
with:
101209
lfs: true
102210
- name: Create temporary keychain
103-
if: matrix.targetPlatform == 'StandaloneOSX' && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneOSX')
211+
if: contains(matrix.targetPlatform, 'StandaloneOSX') && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform)
104212
run: |
105213
security list-keychains
106214
security delete-keychain temporary || true
@@ -113,32 +221,34 @@ jobs:
113221
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
114222
with:
115223
name: Build-${{ matrix.targetPlatform }}
116-
path: sample/Tests
224+
path: ${{ matrix.projectPath }}/Tests
117225
- name: Make macOS artifact executable
118-
if: matrix.targetPlatform == 'StandaloneOSX' && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneOSX')
119-
run: chmod +x sample/Tests/SampleApp.app/Contents/MacOS/*
226+
if: |
227+
contains(matrix.targetPlatform, 'StandaloneOSX') &&
228+
(github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform)
229+
run: chmod -R +x '${{ matrix.projectPath }}/Tests/${{ matrix.unityAppName }}.app/Contents/MacOS'
120230
- uses: actions/setup-python@v4
121231
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
122232
with:
123233
python-version: "3.13"
124234
- name: Install dependencies (Windows)
125235
if: matrix.targetPlatform == 'StandaloneWindows64' && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneWindows64')
126-
run: pip install -r "sample/Tests/requirements-desktop.txt"
236+
run: pip install -r "${{ matrix.projectPath }}/Tests/requirements-desktop.txt"
127237
- name: Install dependencies (Mac)
128-
if: matrix.targetPlatform == 'StandaloneOSX' && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneOSX')
129-
run: pip install -r "sample/Tests/requirements-desktop.txt"
238+
if: contains(matrix.targetPlatform, 'StandaloneOSX') && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform)
239+
run: pip install -r "${{ matrix.projectPath }}/Tests/requirements-desktop.txt"
130240
- name: Run UI tests
131241
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
132-
env:
133-
UNITY_APP_PATH: SampleApp.app
134-
UNITY_APP_NAME: SampleApp
242+
env:
243+
UNITY_APP_PATH: ${{ matrix.unityAppName }}${{ matrix.unityAppExtension }}
244+
UNITY_APP_NAME: ${{ matrix.unityAppName }}
135245
MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }}
136246
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
137247
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
138-
working-directory: sample/Tests
248+
working-directory: ${{ matrix.projectPath }}/Tests
139249
run: ${{ matrix.test_script }}
140250
- name: Remove temporary keychain
141-
if: matrix.targetPlatform == 'StandaloneOSX' && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneOSX')
251+
if: contains(matrix.targetPlatform, 'StandaloneOSX') && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform)
142252
run: |
143253
security list-keychains
144254
security delete-keychain temporary

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,7 @@ __pycache__/
111111
*.pyc
112112
.pytest_cache/
113113

114-
xcuserdata/
114+
xcuserdata/
115+
116+
logFile.log
117+
logFile-improved.log

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ This repository contains two sample projects:
2424
- **`sample/`** - Unity 2021.3.26f1 sample project
2525
- **`sample-unity6/`** - Unity 6 sample project *(work in progress)*
2626

27-
Both projects share the same Scenes and Scripts 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.
27+
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

2929
### First Time Setup (for contributors)
3030

31-
The `sample-unity6` project uses symbolic links to share Scenes and Scripts with the `sample` project.
31+
The `sample-unity6` project uses symbolic links to share Scenes, Scripts, Editor folders, and Tests with the `sample` project.
3232

3333
**macOS/Linux:** Symlinks are created automatically when you clone/pull - no action needed.
3434

3535
**Windows:** Check if symlinks were created correctly:
36-
1. Navigate to `sample-unity6/Assets/`
37-
2. Check if `Scenes` and `Scripts` are folders (symlinks work) or small text files (symlinks didn't work)
36+
1. Navigate to `sample-unity6/Assets/` and `sample-unity6/`
37+
2. Check if `Scenes`, `Scripts`, `Editor`, and `Tests` are folders (symlinks work) or small text files (symlinks didn't work)
3838

3939
If symlinks didn't work, run the setup script:
4040

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3}
13+
m_Name: DefaultVolumeProfile
14+
m_EditorClassIdentifier:
15+
components: []

sample-unity6/Assets/DefaultVolumeProfile.asset.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sample-unity6/Assets/Editor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../sample/Assets/Editor

sample-unity6/Assets/Editor.meta

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../sample/Assets/Editor.meta

sample-unity6/Assets/Resources/AltTester.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"name":"Horizontal","negativeButton":"left","positiveButton":"right","altPositiveButton":"d","altNegativeButton":"a","type":0,"axisDirection":0},{"name":"Vertical","negativeButton":"down","positiveButton":"up","altPositiveButton":"w","altNegativeButton":"s","type":0,"axisDirection":0},{"name":"Fire1","negativeButton":"","positiveButton":"left ctrl","altPositiveButton":"mouse 0","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Fire2","negativeButton":"","positiveButton":"left alt","altPositiveButton":"mouse 1","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Fire3","negativeButton":"","positiveButton":"left shift","altPositiveButton":"mouse 2","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Jump","negativeButton":"","positiveButton":"space","altPositiveButton":"","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Mouse X","negativeButton":"","positiveButton":"","altPositiveButton":"","altNegativeButton":"","type":1,"axisDirection":0},{"name":"Mouse Y","negativeButton":"","positiveButton":"","altPositiveButton":"","altNegativeButton":"","type":1,"axisDirection":1},{"name":"Mouse ScrollWheel","negativeButton":"","positiveButton":"","altPositiveButton":"","altNegativeButton":"","type":1,"axisDirection":2},{"name":"Horizontal","negativeButton":"","positiveButton":"","altPositiveButton":"","altNegativeButton":"","type":2,"axisDirection":0},{"name":"Vertical","negativeButton":"","positiveButton":"","altPositiveButton":"","altNegativeButton":"","type":2,"axisDirection":1},{"name":"Fire1","negativeButton":"","positiveButton":"joystick button 0","altPositiveButton":"","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Fire2","negativeButton":"","positiveButton":"joystick button 1","altPositiveButton":"","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Fire3","negativeButton":"","positiveButton":"joystick button 2","altPositiveButton":"","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Jump","negativeButton":"","positiveButton":"joystick button 3","altPositiveButton":"","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Submit","negativeButton":"","positiveButton":"return","altPositiveButton":"joystick button 0","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Submit","negativeButton":"","positiveButton":"enter","altPositiveButton":"space","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Cancel","negativeButton":"","positiveButton":"escape","altPositiveButton":"joystick button 1","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Enable Debug Button 1","negativeButton":"","positiveButton":"left ctrl","altPositiveButton":"joystick button 8","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Enable Debug Button 2","negativeButton":"","positiveButton":"backspace","altPositiveButton":"joystick button 9","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Reset","negativeButton":"","positiveButton":"left alt","altPositiveButton":"joystick button 1","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Next","negativeButton":"","positiveButton":"page down","altPositiveButton":"joystick button 5","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Previous","negativeButton":"","positiveButton":"page up","altPositiveButton":"joystick button 4","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Validate","negativeButton":"","positiveButton":"return","altPositiveButton":"joystick button 0","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Persistent","negativeButton":"","positiveButton":"right shift","altPositiveButton":"joystick button 2","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Multiplier","negativeButton":"","positiveButton":"left shift","altPositiveButton":"joystick button 3","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Horizontal","negativeButton":"left","positiveButton":"right","altPositiveButton":"","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Vertical","negativeButton":"down","positiveButton":"up","altPositiveButton":"","altNegativeButton":"","type":0,"axisDirection":0},{"name":"Debug Vertical","negativeButton":"down","positiveButton":"up","altPositiveButton":"","altNegativeButton":"","type":2,"axisDirection":6},{"name":"Debug Horizontal","negativeButton":"left","positiveButton":"right","altPositiveButton":"","altNegativeButton":"","type":2,"axisDirection":5}]

0 commit comments

Comments
 (0)