-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run QA test workflow #3499
Merged
+116
−0
Merged
Run QA test workflow #3499
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: Run QA Test # Runs automated tests on a self-hosted QA machine | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Build"] | ||
types: | ||
- completed | ||
|
||
concurrency: | ||
group: qa-test-run | ||
cancel-in-progress: true # Cancels any queued job when a new one starts | ||
|
||
jobs: | ||
install-and-run-sikuli: | ||
runs-on: [self-hosted, qa-machine] | ||
if: > | ||
github.event.workflow_run.conclusion == 'success' && | ||
contains(github.event.workflow_run.head_commit.message, '[Channel: Release]') | ||
|
||
steps: | ||
- name: Verify viewer-sikulix Exists | ||
run: | | ||
if [ ! -d "C:\viewer-sikulix-main" ]; then | ||
echo "❌ Error: viewer-sikulix not found on runner!" | ||
exit 1 | ||
fi | ||
echo "✅ viewer-sikulix is already available." | ||
|
||
- name: Temporarily Allow PowerShell Scripts (Process Scope) | ||
run: | | ||
powershell -ExecutionPolicy Bypass -NoProfile -Command "& { | ||
Set-ExecutionPolicy RemoteSigned -Scope Process -Force | ||
}" | ||
|
||
- name: Fetch & Download Windows Installer Artifact | ||
run: | | ||
BUILD_ID=${{ github.event.workflow_run.id }} | ||
ARTIFACTS_URL="https://api.github.com/repos/secondlife/viewer/actions/runs/$BUILD_ID/artifacts" | ||
|
||
# Fetch the correct artifact URL | ||
ARTIFACT_NAME=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | ||
"$ARTIFACTS_URL" | jq -r '.artifacts[] | select(.name == "Windows-installer") | .archive_download_url') | ||
|
||
if [[ -z "$ARTIFACT_NAME" ]]; then | ||
echo "❌ Error: Windows-installer artifact not found!" | ||
exit 1 | ||
fi | ||
|
||
echo "✅ Artifact found: $ARTIFACT_NAME" | ||
|
||
# Download the ZIP | ||
mkdir -p ~/secondlife-build | ||
curl -L -o ~/secondlife-build/installer.zip -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "$ARTIFACT_NAME" | ||
|
||
# Ensure download succeeded | ||
if [[ ! -f ~/secondlife-build/installer.zip ]]; then | ||
echo "❌ Error: Failed to download Windows-installer.zip" | ||
exit 1 | ||
fi | ||
|
||
- name: Extract Installer & Locate Executable | ||
run: | | ||
powershell -Command "Expand-Archive -Path '$env:USERPROFILE/secondlife-build/installer.zip' -DestinationPath '$env:USERPROFILE/secondlife-build'" | ||
INSTALLER_PATH=$(powershell -Command "(Get-ChildItem -Path '$env:USERPROFILE/secondlife-build' -Filter '*.exe' -Recurse | Select-Object -First 1).FullName") | ||
|
||
if [[ -z "$INSTALLER_PATH" ]]; then | ||
echo "❌ Error: No installer executable found in the extracted files!" | ||
exit 1 | ||
fi | ||
|
||
echo "✅ Installer found: $INSTALLER_PATH" | ||
echo "INSTALLER_PATH=$INSTALLER_PATH" >> $GITHUB_ENV # Save for later use | ||
|
||
- name: Install Second Life Using Task Scheduler (Bypass UAC) | ||
run: | | ||
powershell -ExecutionPolicy Bypass -NoProfile -Command "& { | ||
$action = New-ScheduledTaskAction -Execute '${{ env.INSTALLER_PATH }}' -Argument '/S'; | ||
$principal = New-ScheduledTaskPrincipal -UserId 'SYSTEM' -LogonType ServiceAccount -RunLevel Highest; | ||
$task = New-ScheduledTask -Action $action -Principal $principal; | ||
Register-ScheduledTask -TaskName 'SilentSLInstaller' -InputObject $task -Force; | ||
Start-ScheduledTask -TaskName 'SilentSLInstaller'; | ||
}" | ||
|
||
- name: Wait for Installation to Complete | ||
run: | | ||
echo "Waiting for the Second Life installer to finish..." | ||
powershell -ExecutionPolicy Bypass -NoProfile -Command "& { | ||
do { | ||
Start-Sleep -Seconds 5 | ||
$installerProcess = Get-Process | Where-Object { $_.Path -eq '${{ env.INSTALLER_PATH }}' } | ||
} while ($installerProcess) | ||
}" | ||
echo "✅ Installation completed!" | ||
|
||
- name: Cleanup Task Scheduler Entry | ||
run: | | ||
powershell -ExecutionPolicy Bypass -NoProfile -Command "& { | ||
Unregister-ScheduledTask -TaskName 'SilentSLInstaller' -Confirm:$false | ||
}" | ||
echo "✅ Task Scheduler entry removed." | ||
|
||
- name: Delete Installer ZIP | ||
run: | | ||
rm -rf ~/secondlife-build/installer.zip | ||
echo "✅ Installer ZIP deleted." | ||
|
||
- name: Run Python Script | ||
run: | | ||
echo "Running Python script..." | ||
python C:\viewer-sikulix-main\runTests.py | ||
|
||
- name: Upload Test Results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: test-results | ||
path: C:\viewer-sikulix-main\regressionTest\test_results.html |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to get started we will probably want to change this to be
workflow_dispatch