Skip to content

Commit f6b4201

Browse files
committed
ci: unity 6 mac build
1 parent c6253c8 commit f6b4201

25 files changed

+730
-49
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
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

.github/workflows/ui-tests.yml

Lines changed: 40 additions & 16 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,28 @@ 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
41+
# Unity 6 macOS build (also triggered when StandaloneOSX is selected)
42+
- targetPlatform: StandaloneOSX-Unity6
43+
buildMethod: MacBuilderUnity6.BuildForAltTester
44+
buildPath: sample-unity6/Builds/MacOS
45+
projectPath: sample-unity6
46+
unityVersion: 6000.0.58f1
3747
- targetPlatform: StandaloneWindows64
3848
buildMethod: WindowsBuilder.BuildForAltTester
3949
buildPath: sample/Builds/Windows64
50+
projectPath: sample
51+
unityVersion: 2021.3.26f1
4052
- targetPlatform: Android
4153
buildMethod: MobileBuilder.BuildForAltTester
4254
buildPath: sample/Builds/Android
55+
projectPath: sample
56+
unityVersion: 2021.3.26f1
4357
steps:
4458
- uses: actions/checkout@v3
4559
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
@@ -49,7 +63,7 @@ jobs:
4963
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
5064
with:
5165
path: Library
52-
key: Library-${{ matrix.targetPlatform }}-${{ hashFiles('sample/Assets/**', 'sample/Packages/**', 'sample/ProjectSettings/**') }}
66+
key: Library-${{ matrix.targetPlatform }}-${{ hashFiles(format('{0}/Assets/**', matrix.projectPath), format('{0}/Packages/**', matrix.projectPath), format('{0}/ProjectSettings/**', matrix.projectPath)) }}
5367
restore-keys: |
5468
Library-${{ matrix.targetPlatform }}
5569
Library-
@@ -61,8 +75,9 @@ jobs:
6175
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
6276
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
6377
with:
64-
targetPlatform: ${{ matrix.targetPlatform }}
65-
projectPath: sample
78+
targetPlatform: ${{ contains(matrix.targetPlatform, 'Unity6') && 'StandaloneOSX' || matrix.targetPlatform }}
79+
projectPath: ${{ matrix.projectPath }}
80+
unityVersion: ${{ matrix.unityVersion }}
6681
buildMethod: ${{ matrix.buildMethod }}
6782
customParameters: -logFile logFile.log -quit -batchmode
6883
artifactsPath: ${{ matrix.buildPath }}
@@ -84,9 +99,18 @@ jobs:
8499
- targetPlatform: StandaloneOSX
85100
runs-on: [self-hosted, macOS]
86101
test_script: pytest -xs test/test_mac.py::MacTest
102+
projectPath: sample
103+
unityAppName: SampleApp
104+
- targetPlatform: StandaloneOSX-Unity6
105+
runs-on: [self-hosted, macOS]
106+
test_script: pytest -xs test/test_mac.py::MacTest
107+
projectPath: sample-unity6
108+
unityAppName: Sample Unity 6 macOS
87109
- targetPlatform: StandaloneWindows64
88110
runs-on: [self-hosted, windows]
89111
test_script: python -m pytest -xs test/test_windows.py::WindowsTest
112+
projectPath: sample
113+
unityAppName: SampleApp
90114
# - targetPlatform: Android
91115
# runs-on: [ self-hosted, macOS ]
92116
# test_script: browserstack-sdk pytest -s ./test/test_android.py --browserstack.config "browserstack.android.yml"
@@ -100,7 +124,7 @@ jobs:
100124
with:
101125
lfs: true
102126
- name: Create temporary keychain
103-
if: matrix.targetPlatform == 'StandaloneOSX' && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneOSX')
127+
if: contains(matrix.targetPlatform, 'StandaloneOSX') && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform)
104128
run: |
105129
security list-keychains
106130
security delete-keychain temporary || true
@@ -113,32 +137,32 @@ jobs:
113137
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
114138
with:
115139
name: Build-${{ matrix.targetPlatform }}
116-
path: sample/Tests
140+
path: ${{ matrix.projectPath }}/Tests
117141
- 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/*
142+
if: contains(matrix.targetPlatform, 'StandaloneOSX') && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform)
143+
run: chmod +x ${{ matrix.projectPath }}/Tests/${{ matrix.unityAppName }}.app/Contents/MacOS/*
120144
- uses: actions/setup-python@v4
121145
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform
122146
with:
123147
python-version: "3.13"
124148
- name: Install dependencies (Windows)
125149
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"
150+
run: pip install -r "${{ matrix.projectPath }}/Tests/requirements-desktop.txt"
127151
- 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"
152+
if: contains(matrix.targetPlatform, 'StandaloneOSX') && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform)
153+
run: pip install -r "${{ matrix.projectPath }}/Tests/requirements-desktop.txt"
130154
- name: Run UI tests
131155
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
156+
env:
157+
UNITY_APP_PATH: ${{ matrix.unityAppName }}.app
158+
UNITY_APP_NAME: ${{ matrix.unityAppName }}
135159
MAILSLURP_API_KEY: ${{ secrets.MAILSLURP_API_KEY }}
136160
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
137161
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
138-
working-directory: sample/Tests
162+
working-directory: ${{ matrix.projectPath }}/Tests
139163
run: ${{ matrix.test_script }}
140164
- name: Remove temporary keychain
141-
if: matrix.targetPlatform == 'StandaloneOSX' && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneOSX')
165+
if: contains(matrix.targetPlatform, 'StandaloneOSX') && (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform)
142166
run: |
143167
security list-keychains
144168
security delete-keychain temporary

README.md

Lines changed: 3 additions & 3 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, and Editor folders 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, and Editor folders 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:
3636
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)
37+
2. Check if `Scenes`, `Scripts`, and `Editor` 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/Settings/Build Profiles/macOS Profile.asset

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ MonoBehaviour:
3535
- line: '| useOnDemandResources: 0'
3636
- line: '| accelerometerFrequency: 60'
3737
- line: '| companyName: Immutable'
38-
- line: '| productName: Sample Unity 6 macOS'
38+
- line: '| productName: SampleApp'
3939
- line: '| defaultCursor: {instanceID: 0}'
4040
- line: '| cursorHotspot: {x: 0, y: 0}'
4141
- line: '| m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b:
@@ -793,7 +793,8 @@ MonoBehaviour:
793793
- line: '| webGLWebAssemblyBigInt: 0'
794794
- line: '| webGLCloseOnQuit: 0'
795795
- line: '| webWasm2023: 0'
796-
- line: '| scriptingDefineSymbols: {}'
796+
- line: '| scriptingDefineSymbols:'
797+
- line: '| Standalone: VUPLEX_STANDALONE;VUPLEX_WEBVIEW'
797798
- line: '| additionalCompilerArguments: {}'
798799
- line: '| platformArchitecture: {}'
799800
- line: '| scriptingBackend:'

0 commit comments

Comments
 (0)