|
13 | 13 | - All |
14 | 14 | - StandaloneOSX # Builds Unity 2021 macOS only |
15 | 15 | - StandaloneOSX-Unity6 # Builds Unity 6 macOS only |
16 | | - - StandaloneWindows64 |
| 16 | + - StandaloneWindows64 # Builds Unity 2021 Windows only |
| 17 | + - StandaloneWindows64-Unity6 # Builds Unity 6 Windows only |
17 | 18 | # - Android |
18 | 19 | # - iOS |
19 | 20 | push: |
|
88 | 89 | name: Build & Test Unity 6 macOS 🛠️🧪 |
89 | 90 | runs-on: [self-hosted, macOS] |
90 | 91 | 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 |
93 | 94 | if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneOSX-Unity6' |
94 | 95 | steps: |
95 | 96 | - name: Cleanup old builds |
@@ -171,7 +172,78 @@ jobs: |
171 | 172 | if: always() |
172 | 173 | uses: actions/upload-artifact@v4 |
173 | 174 | 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 |
175 | 247 | path: sample-unity6/build-log.log |
176 | 248 |
|
177 | 249 | test: |
|
0 commit comments