|
90 | 90 | runs-on: [self-hosted, macOS] |
91 | 91 | if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneOSX-Unity6' |
92 | 92 | steps: |
| 93 | + - name: Cleanup old builds |
| 94 | + run: | |
| 95 | + # Remove all previous builds to save space |
| 96 | + rm -rf /tmp/unity-builds/* 2>/dev/null || true |
93 | 97 | - uses: actions/checkout@v3 |
94 | 98 | with: |
95 | 99 | lfs: true |
@@ -117,28 +121,24 @@ jobs: |
117 | 121 | echo "Building Unity 6 macOS using command line..." |
118 | 122 | export TMPDIR="/Users/svc_buildsdk/tmp" |
119 | 123 | mkdir -p "$TMPDIR" |
120 | | - mkdir -p sample-unity6/Tests |
| 124 | + BUILD_DIR="/tmp/unity-builds/${{ github.run_id }}" |
| 125 | + mkdir -p "$BUILD_DIR" |
121 | 126 | /Applications/Unity/Hub/Editor/6000.0.58f1/Unity.app/Contents/MacOS/Unity \ |
122 | 127 | -projectPath "${{ github.workspace }}/sample-unity6" \ |
123 | 128 | -executeMethod "MacBuilderUnity6.BuildForAltTester" \ |
124 | 129 | -logFile "${{ github.workspace }}/sample-unity6/build-log.txt" \ |
125 | 130 | -quit \ |
126 | 131 | -batchmode \ |
127 | | - --buildPath "${{ github.workspace }}/sample-unity6/Tests" |
| 132 | + --buildPath "$BUILD_DIR" |
128 | 133 | |
129 | 134 | echo "Build completed. Checking for build output..." |
130 | | - ls -la sample-unity6/Tests/ |
| 135 | + ls -la "$BUILD_DIR" |
131 | 136 | - name: Upload build log |
132 | 137 | if: always() |
133 | 138 | uses: actions/upload-artifact@v4 |
134 | 139 | with: |
135 | 140 | name: Unity6-Build-Log |
136 | 141 | path: sample-unity6/build-log.txt |
137 | | - - name: Upload artifact |
138 | | - uses: actions/upload-artifact@v4 |
139 | | - with: |
140 | | - name: Build-StandaloneOSX-Unity6 |
141 | | - path: sample-unity6/Tests |
142 | 142 |
|
143 | 143 | test: |
144 | 144 | name: Run ${{ matrix.targetPlatform }} UI tests 🧪 |
@@ -191,10 +191,22 @@ jobs: |
191 | 191 | security unlock-keychain -p "" temporary |
192 | 192 | security set-keychain-settings -lut 600 temporary |
193 | 193 | - uses: actions/download-artifact@v4 |
194 | | - if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform |
| 194 | + if: | |
| 195 | + matrix.targetPlatform != 'StandaloneOSX-Unity6' && |
| 196 | + (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform) |
195 | 197 | with: |
196 | 198 | name: Build-${{ matrix.targetPlatform }} |
197 | 199 | path: ${{ matrix.projectPath }}/Tests |
| 200 | + - name: Copy Unity 6 build from shared directory |
| 201 | + if: | |
| 202 | + matrix.targetPlatform == 'StandaloneOSX-Unity6' && |
| 203 | + (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform) |
| 204 | + run: | |
| 205 | + BUILD_APP="/tmp/unity-builds/${{ github.run_id }}.app" |
| 206 | + mkdir -p "${{ matrix.projectPath }}/Tests" |
| 207 | + cp -R "$BUILD_APP" "${{ matrix.projectPath }}/Tests/" |
| 208 | + echo "Build copied from shared directory:" |
| 209 | + ls -la "${{ matrix.projectPath }}/Tests/" |
198 | 210 | - name: Make macOS artifact executable |
199 | 211 | if: | |
200 | 212 | contains(matrix.targetPlatform, 'StandaloneOSX') && |
@@ -228,6 +240,16 @@ jobs: |
228 | 240 | security default-keychain -s ~/Library/Keychains/login.keychain-db |
229 | 241 | security list-keychains -d user -s ~/Library/Keychains/login.keychain-db |
230 | 242 | security list-keychains |
| 243 | + - name: Cleanup Unity 6 shared build |
| 244 | + if: | |
| 245 | + always() && |
| 246 | + matrix.targetPlatform == 'StandaloneOSX-Unity6' && |
| 247 | + (github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == matrix.targetPlatform) |
| 248 | + run: | |
| 249 | + BUILD_APP="/tmp/unity-builds/${{ github.run_id }}.app" |
| 250 | + echo "Cleaning up shared build: $BUILD_APP" |
| 251 | + rm -rf "$BUILD_APP" |
| 252 | + echo "✅ Cleanup completed" |
231 | 253 | build-ios: #test-ios: |
232 | 254 | name: Run iOS build #UI tests 🧪 |
233 | 255 | needs: |
|
0 commit comments