5
5
workflows : ["Build"]
6
6
types :
7
7
- completed
8
+ workflow_dispatch :
9
+ inputs :
10
+ branch_name :
11
+ description : ' Branch name to simulate workflow (e.g. develop)'
12
+ required : true
13
+ default : ' develop'
14
+ build_id :
15
+ description : ' Build workflow run ID (e.g. For github.com/secondlife/viewer/actions/runs/1234567890 the ID is 1234567890)'
16
+ required : true
17
+ default : ' 14806728332'
8
18
9
19
concurrency :
10
- group : qa-test-run
11
- cancel-in-progress : true # Cancels any queued job when a new one starts
20
+ group : qa-test-run-${{ matrix.runner }}
21
+ cancel-in-progress : false # Prevents cancellation of in-progress jobs
12
22
13
23
jobs :
14
24
debug-workflow :
@@ -26,39 +36,75 @@ jobs:
26
36
echo "GitHub Workflow Name: ${{ github.workflow }}"
27
37
28
38
install-viewer-and-run-tests :
29
- runs-on : [self-hosted, qa-machine]
30
- # Run test only on successful builds of Second_Life_X branches
39
+ strategy :
40
+ matrix :
41
+ include :
42
+ - os : windows
43
+ runner : qa-windows-atlas
44
+ artifact : Windows-installer
45
+ install-path : ' C:\viewer-sikulix-main'
46
+ - os : windows
47
+ runner : qa-dan-asus
48
+ artifact : Windows-installer
49
+ install-path : ' C:\viewer-sikulix-main'
50
+ # Commented out until mac runner is available
51
+ # - os: mac
52
+ # runner: qa-mac
53
+ # artifact: Mac-installer
54
+ # install-path: 'HOME/Documents/viewer-sikulix-main'
55
+ fail-fast : false
56
+
57
+ runs-on : [self-hosted, "${{ matrix.runner }}"]
58
+ # Run test only on successful builds of Second_Life_X branches or on manual dispatch
31
59
if : >
60
+ (github.event_name == 'workflow_run' &&
32
61
github.event.workflow_run.conclusion == 'success' &&
33
- (
34
- startsWith(github.event.workflow_run.head_branch, 'Second_Life')
35
- )
62
+ startsWith(github.event.workflow_run.head_branch, 'Second_Life')) ||
63
+ github.event_name == 'workflow_dispatch'
36
64
37
65
steps :
38
- - name : Temporarily Allow PowerShell Scripts (Process Scope)
66
+ # Common steps for both OSes
67
+ - name : Set Build ID
68
+ shell : bash
69
+ run : |
70
+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
71
+ echo "BUILD_ID=${{ github.event.inputs.build_id }}" >> $GITHUB_ENV
72
+ echo "ARTIFACTS_URL=https://api.github.com/repos/secondlife/viewer/actions/runs/${{ github.event.inputs.build_id }}/artifacts" >> $GITHUB_ENV
73
+ else
74
+ echo "BUILD_ID=${{ github.event.workflow_run.id }}" >> $GITHUB_ENV
75
+ echo "ARTIFACTS_URL=https://api.github.com/repos/secondlife/viewer/actions/runs/${{ github.event.workflow_run.id }}/artifacts" >> $GITHUB_ENV
76
+ fi
77
+
78
+ # Windows-specific steps
79
+ - name : Temporarily Allow PowerShell Scripts (Windows)
80
+ if : matrix.os == 'windows'
81
+ shell : pwsh
39
82
run : |
40
83
Set-ExecutionPolicy RemoteSigned -Scope Process -Force
41
84
42
- - name : Verify viewer-sikulix-main Exists
85
+ - name : Verify viewer-sikulix-main Exists (Windows)
86
+ if : matrix.os == 'windows'
87
+ shell : pwsh
43
88
run : |
44
- if (-Not (Test-Path -Path 'C:\viewer-sikulix-main ')) {
89
+ if (-Not (Test-Path -Path '${{ matrix.install-path }} ')) {
45
90
Write-Host '❌ Error: viewer-sikulix not found on runner!'
46
91
exit 1
47
92
}
48
93
Write-Host '✅ viewer-sikulix is already available.'
49
94
50
- - name : Fetch & Download Windows Installer Artifact
95
+ - name : Fetch & Download Installer Artifact (Windows)
96
+ if : matrix.os == 'windows'
51
97
shell : pwsh
52
98
run : |
53
- $BUILD_ID = "${{ github.event.workflow_run.id }}"
54
- $ARTIFACTS_URL = "https://api.github.com/repos/secondlife/viewer/actions/runs/$BUILD_ID/artifacts "
99
+ $BUILD_ID = "${{ env.BUILD_ID }}"
100
+ $ARTIFACTS_URL = "${{ env.ARTIFACTS_URL }} "
55
101
56
102
# Fetch the correct artifact URL
57
103
$response = Invoke-RestMethod -Headers @{Authorization="token ${{ secrets.GITHUB_TOKEN }}" } -Uri $ARTIFACTS_URL
58
- $ARTIFACT_NAME = ($response.artifacts | Where-Object { $_.name -eq "Windows-installer " }).archive_download_url
104
+ $ARTIFACT_NAME = ($response.artifacts | Where-Object { $_.name -eq "${{ matrix.artifact }} " }).archive_download_url
59
105
60
106
if (-Not $ARTIFACT_NAME) {
61
- Write-Host "❌ Error: Windows-installer artifact not found!"
107
+ Write-Host "❌ Error: ${{ matrix.artifact }} artifact not found!"
62
108
exit 1
63
109
}
64
110
@@ -74,16 +120,19 @@ jobs:
74
120
75
121
# Ensure download succeeded
76
122
if (-Not (Test-Path $InstallerPath)) {
77
- Write-Host "❌ Error: Failed to download Windows-installer .zip"
123
+ Write-Host "❌ Error: Failed to download ${{ matrix.artifact }} .zip"
78
124
exit 1
79
125
}
80
126
81
- - name : Extract Installer & Locate Executable
127
+ # Set the path for other steps
128
+ echo "DOWNLOAD_PATH=$DownloadPath" | Out-File -FilePath $env:GITHUB_ENV -Append
129
+
130
+ - name : Extract Installer & Locate Executable (Windows)
131
+ if : matrix.os == 'windows'
82
132
shell : pwsh
83
133
run : |
84
- # Explicitly set BUILD_ID again (since it does not appear to persist across steps)
85
- $BUILD_ID = "${{ github.event.workflow_run.id }}"
86
- $ExtractPath = "$env:TEMP\secondlife-build-$BUILD_ID"
134
+ $BUILD_ID = "${{ env.BUILD_ID }}"
135
+ $ExtractPath = "${{ env.DOWNLOAD_PATH }}"
87
136
$InstallerZip = "$ExtractPath\installer.zip"
88
137
89
138
# Print paths for debugging
@@ -113,16 +162,19 @@ jobs:
113
162
Write-Host "✅ Installer found: $INSTALLER_PATH"
114
163
echo "INSTALLER_PATH=$INSTALLER_PATH" | Out-File -FilePath $env:GITHUB_ENV -Append
115
164
116
- - name : Install Second Life Using Task Scheduler (Bypass UAC)
165
+ - name : Install Second Life (Windows)
166
+ if : matrix.os == 'windows'
117
167
shell : pwsh
118
168
run : |
169
+ # Windows - Use Task Scheduler to bypass UAC
119
170
$action = New-ScheduledTaskAction -Execute "${{ env.INSTALLER_PATH }}" -Argument "/S"
120
171
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -LogonType ServiceAccount -RunLevel Highest
121
172
$task = New-ScheduledTask -Action $action -Principal $principal
122
173
Register-ScheduledTask -TaskName "SilentSLInstaller" -InputObject $task -Force
123
174
Start-ScheduledTask -TaskName "SilentSLInstaller"
124
175
125
- - name : Wait for Installation to Complete
176
+ - name : Wait for Installation to Complete (Windows)
177
+ if : matrix.os == 'windows'
126
178
shell : pwsh
127
179
run : |
128
180
Write-Host "Waiting for the Second Life installer to finish..."
@@ -133,18 +185,16 @@ jobs:
133
185
134
186
Write-Host "✅ Installation completed!"
135
187
136
- - name : Cleanup Task Scheduler Entry
188
+ - name : Cleanup After Installation (Windows)
189
+ if : matrix.os == 'windows'
137
190
shell : pwsh
138
191
run : |
192
+ # Cleanup Task Scheduler Entry
139
193
Unregister-ScheduledTask -TaskName "SilentSLInstaller" -Confirm:$false
140
194
Write-Host "✅ Task Scheduler entry removed."
141
195
142
- - name : Delete Installer ZIP
143
- shell : pwsh
144
- run : |
145
- # Explicitly set BUILD_ID again
146
- $BUILD_ID = "${{ github.event.workflow_run.id }}"
147
- $DeletePath = "$env:TEMP\secondlife-build-$BUILD_ID\installer.zip"
196
+ # Delete Installer ZIP
197
+ $DeletePath = "${{ env.DOWNLOAD_PATH }}\installer.zip"
148
198
149
199
Write-Host "Checking if installer ZIP exists: $DeletePath"
150
200
@@ -156,13 +206,164 @@ jobs:
156
206
Write-Host "⚠️ Warning: ZIP file does not exist, skipping deletion."
157
207
}
158
208
159
- - name : Run QA Test Script
209
+ - name : Run QA Test Script (Windows)
210
+ if : matrix.os == 'windows'
211
+ shell : pwsh
212
+ run : |
213
+ Write-Host "Running QA Test script on Windows runner: ${{ matrix.runner }}..."
214
+ python "${{ matrix.install-path }}\runTests.py"
215
+
216
+ # Mac-specific steps
217
+ - name : Verify viewer-sikulix-main Exists (Mac)
218
+ if : matrix.os == 'mac'
219
+ shell : bash
220
+ run : |
221
+ if [ ! -d "${{ matrix.install-path }}" ]; then
222
+ echo "❌ Error: viewer-sikulix not found on runner!"
223
+ exit 1
224
+ fi
225
+ echo "✅ viewer-sikulix is already available."
226
+
227
+ - name : Fetch & Download Installer Artifact (Mac)
228
+ if : matrix.os == 'mac'
229
+ shell : bash
230
+ run : |
231
+ # Mac-specific Bash commands
232
+ response=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s ${{ env.ARTIFACTS_URL }})
233
+ ARTIFACT_NAME=$(echo $response | jq -r '.artifacts[] | select(.name=="${{ matrix.artifact }}") | .archive_download_url')
234
+
235
+ if [ -z "$ARTIFACT_NAME" ]; then
236
+ echo "❌ Error: ${{ matrix.artifact }} artifact not found!"
237
+ exit 1
238
+ fi
239
+
240
+ echo "✅ Artifact found: $ARTIFACT_NAME"
241
+
242
+ # Secure download path
243
+ DOWNLOAD_PATH="/tmp/secondlife-build-${{ env.BUILD_ID }}"
244
+ mkdir -p $DOWNLOAD_PATH
245
+ INSTALLER_PATH="$DOWNLOAD_PATH/installer.zip"
246
+
247
+ # Download the ZIP
248
+ curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -L $ARTIFACT_NAME -o $INSTALLER_PATH
249
+
250
+ # Ensure download succeeded
251
+ if [ ! -f "$INSTALLER_PATH" ]; then
252
+ echo "❌ Error: Failed to download ${{ matrix.artifact }}.zip"
253
+ exit 1
254
+ fi
255
+
256
+ # Set the path for other steps
257
+ echo "DOWNLOAD_PATH=$DOWNLOAD_PATH" >> $GITHUB_ENV
258
+
259
+ - name : Extract Installer & Locate Executable (Mac)
260
+ if : matrix.os == 'mac'
261
+ shell : bash
262
+ run : |
263
+ EXTRACT_PATH="${{ env.DOWNLOAD_PATH }}"
264
+ INSTALLER_ZIP="$EXTRACT_PATH/installer.zip"
265
+
266
+ # Debug output
267
+ echo "Extract Path: $EXTRACT_PATH"
268
+ echo "Installer ZIP Path: $INSTALLER_ZIP"
269
+
270
+ # Verify ZIP exists
271
+ if [ ! -f "$INSTALLER_ZIP" ]; then
272
+ echo "❌ Error: ZIP file not found at $INSTALLER_ZIP!"
273
+ exit 1
274
+ fi
275
+
276
+ echo "✅ ZIP file exists and is valid. Extracting..."
277
+
278
+ # Extract the ZIP
279
+ unzip -o "$INSTALLER_ZIP" -d "$EXTRACT_PATH"
280
+
281
+ # Find DMG file
282
+ INSTALLER_PATH=$(find "$EXTRACT_PATH" -name "*.dmg" -type f | head -1)
283
+
284
+ if [ -z "$INSTALLER_PATH" ]; then
285
+ echo "❌ Error: No installer DMG found in the extracted files!"
286
+ echo "📂 Extracted Files:"
287
+ ls -la "$EXTRACT_PATH"
288
+ exit 1
289
+ fi
290
+
291
+ echo "✅ Installer found: $INSTALLER_PATH"
292
+ echo "INSTALLER_PATH=$INSTALLER_PATH" >> $GITHUB_ENV
293
+
294
+ - name : Install Second Life (Mac)
295
+ if : matrix.os == 'mac'
296
+ shell : bash
297
+ run : |
298
+ # Mac installation
299
+ echo "Mounting DMG installer..."
300
+ MOUNT_POINT="/tmp/secondlife-dmg"
301
+ mkdir -p "$MOUNT_POINT"
302
+
303
+ # Mount the DMG
304
+ hdiutil attach "${{ env.INSTALLER_PATH }}" -mountpoint "$MOUNT_POINT" -nobrowse
305
+
306
+ echo "✅ DMG mounted at $MOUNT_POINT"
307
+
308
+ # Find the app in the mounted DMG
309
+ APP_PATH=$(find "$MOUNT_POINT" -name "*.app" -type d | head -1)
310
+
311
+ if [ -z "$APP_PATH" ]; then
312
+ echo "❌ Error: No .app bundle found in the mounted DMG!"
313
+ exit 1
314
+ fi
315
+
316
+ echo "Installing application to Applications folder..."
317
+
318
+ # Copy the app to the Applications folder (or specified install path)
319
+ cp -R "$APP_PATH" "${{ matrix.install-path }}"
320
+
321
+ # Verify the app was copied successfully
322
+ if [ ! -d "${{ matrix.install-path }}/$(basename "$APP_PATH")" ]; then
323
+ echo "❌ Error: Failed to install application to ${{ matrix.install-path }}!"
324
+ exit 1
325
+ fi
326
+
327
+ echo "✅ Application installed successfully to ${{ matrix.install-path }}"
328
+
329
+ # Save mount point for cleanup
330
+ echo "MOUNT_POINT=$MOUNT_POINT" >> $GITHUB_ENV
331
+
332
+ - name : Wait for Installation to Complete (Mac)
333
+ if : matrix.os == 'mac'
334
+ shell : bash
335
+ run : |
336
+ echo "Waiting for installation to complete..."
337
+ # Sleep to allow installation to finish (adjust as needed)
338
+ sleep 30
339
+ echo "✅ Installation completed"
340
+
341
+ - name : Cleanup After Installation (Mac)
342
+ if : matrix.os == 'mac'
343
+ shell : bash
344
+ run : |
345
+ # Mac cleanup
346
+ # Unmount the DMG
347
+ echo "Unmounting DMG..."
348
+ hdiutil detach "${{ env.MOUNT_POINT }}" -force
349
+
350
+ # Clean up temporary files
351
+ echo "Cleaning up temporary files..."
352
+ rm -rf "${{ env.DOWNLOAD_PATH }}"
353
+ rm -rf "${{ env.MOUNT_POINT }}"
354
+
355
+ echo "✅ Cleanup completed"
356
+
357
+ - name : Run QA Test Script (Mac)
358
+ if : matrix.os == 'mac'
359
+ shell : bash
160
360
run : |
161
- Write-Host "Running QA Test script..."
162
- python C:\viewer-sikulix-main\ runTests.py
361
+ echo "Running QA Test script on Mac runner: ${{ matrix.runner }} ..."
362
+ python "${{ matrix.install-path }}/ runTests.py"
163
363
164
364
# - name: Upload Test Results
165
- # uses: actions/upload-artifact@v3
365
+ # if: always()
366
+ # uses: actions/upload-artifact@v4
166
367
# with:
167
- # name: test-results
168
- # path: C:\viewer-sikulix-main\ regressionTest\ test_results.html
368
+ # name: test-results-${{ matrix.runner }}
369
+ # path: ${{ matrix.install-path }}/ regressionTest/ test_results.html
0 commit comments