Skip to content

Commit 12fe7c6

Browse files
committed
ci: mac unity 6 build shared directory
1 parent 5d96804 commit 12fe7c6

File tree

1 file changed

+31
-9
lines changed

1 file changed

+31
-9
lines changed

.github/workflows/ui-tests.yml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ jobs:
9090
runs-on: [self-hosted, macOS]
9191
if: github.event_name != 'workflow_dispatch' || github.event.inputs.targetPlatform == 'All' || github.event.inputs.targetPlatform == 'StandaloneOSX-Unity6'
9292
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
9397
- uses: actions/checkout@v3
9498
with:
9599
lfs: true
@@ -117,28 +121,24 @@ jobs:
117121
echo "Building Unity 6 macOS using command line..."
118122
export TMPDIR="/Users/svc_buildsdk/tmp"
119123
mkdir -p "$TMPDIR"
120-
mkdir -p sample-unity6/Tests
124+
BUILD_DIR="/tmp/unity-builds/${{ github.run_id }}"
125+
mkdir -p "$BUILD_DIR"
121126
/Applications/Unity/Hub/Editor/6000.0.58f1/Unity.app/Contents/MacOS/Unity \
122127
-projectPath "${{ github.workspace }}/sample-unity6" \
123128
-executeMethod "MacBuilderUnity6.BuildForAltTester" \
124129
-logFile "${{ github.workspace }}/sample-unity6/build-log.txt" \
125130
-quit \
126131
-batchmode \
127-
--buildPath "${{ github.workspace }}/sample-unity6/Tests"
132+
--buildPath "$BUILD_DIR"
128133
129134
echo "Build completed. Checking for build output..."
130-
ls -la sample-unity6/Tests/
135+
ls -la "$BUILD_DIR"
131136
- name: Upload build log
132137
if: always()
133138
uses: actions/upload-artifact@v4
134139
with:
135140
name: Unity6-Build-Log
136141
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
142142

143143
test:
144144
name: Run ${{ matrix.targetPlatform }} UI tests 🧪
@@ -191,10 +191,22 @@ jobs:
191191
security unlock-keychain -p "" temporary
192192
security set-keychain-settings -lut 600 temporary
193193
- 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)
195197
with:
196198
name: Build-${{ matrix.targetPlatform }}
197199
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/"
198210
- name: Make macOS artifact executable
199211
if: |
200212
contains(matrix.targetPlatform, 'StandaloneOSX') &&
@@ -228,6 +240,16 @@ jobs:
228240
security default-keychain -s ~/Library/Keychains/login.keychain-db
229241
security list-keychains -d user -s ~/Library/Keychains/login.keychain-db
230242
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"
231253
build-ios: #test-ios:
232254
name: Run iOS build #UI tests 🧪
233255
needs:

0 commit comments

Comments
 (0)