Skip to content

Introduce workflow dispatch, matrix strategy and mac functionality to qatest.yaml #4031

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

AtlasLinden
Copy link
Contributor

A workflow dispatch has been added to not only manually trigger this workflow but to also hopefully be able to test this from a different branch without having to first merge to develop.

Added a matrix strategy to run the QA workflow on multiple runners simultaneously. In this case for runners: qa-windows-atlas and qa-dan-asus.

Also steps have been added to allow this workflow to run on mac runners when they're set up one day. Mac runner info currently commented out.

A workflow dispatch has been added in an attempt to not only manually trigger this workflow but to also test this from a different branch without having to first merge to develop.

Also steps have been added to allow this workflow to run on mac runners when added. Mac runner info currently commented out.
Comment on lines 39 to 369
echo "✅ ZIP file exists and is valid. Extracting..."
# Extract the ZIP
unzip -o "$INSTALLER_ZIP" -d "$EXTRACT_PATH"
# Find DMG file
INSTALLER_PATH=$(find "$EXTRACT_PATH" -name "*.dmg" -type f | head -1)
if [ -z "$INSTALLER_PATH" ]; then
echo "❌ Error: No installer DMG found in the extracted files!"
echo "📂 Extracted Files:"
ls -la "$EXTRACT_PATH"
exit 1
fi
echo "✅ Installer found: $INSTALLER_PATH"
echo "INSTALLER_PATH=$INSTALLER_PATH" >> $GITHUB_ENV
- name: Install Second Life (Mac)
if: matrix.os == 'mac'
shell: bash
run: |
# Mac installation
echo "Mounting DMG installer..."
MOUNT_POINT="/tmp/secondlife-dmg"
mkdir -p "$MOUNT_POINT"
# Mount the DMG
hdiutil attach "${{ env.INSTALLER_PATH }}" -mountpoint "$MOUNT_POINT" -nobrowse
echo "✅ DMG mounted at $MOUNT_POINT"
# Find the app in the mounted DMG
APP_PATH=$(find "$MOUNT_POINT" -name "*.app" -type d | head -1)
if [ -z "$APP_PATH" ]; then
echo "❌ Error: No .app bundle found in the mounted DMG!"
exit 1
fi
echo "Installing application to Applications folder..."
# Copy the app to the Applications folder (or specified install path)
cp -R "$APP_PATH" "${{ matrix.install-path }}"
# Verify the app was copied successfully
if [ ! -d "${{ matrix.install-path }}/$(basename "$APP_PATH")" ]; then
echo "❌ Error: Failed to install application to ${{ matrix.install-path }}!"
exit 1
fi
echo "✅ Application installed successfully to ${{ matrix.install-path }}"
# Save mount point for cleanup
echo "MOUNT_POINT=$MOUNT_POINT" >> $GITHUB_ENV
- name: Wait for Installation to Complete (Mac)
if: matrix.os == 'mac'
shell: bash
run: |
echo "Waiting for installation to complete..."
# Sleep to allow installation to finish (adjust as needed)
sleep 30
echo "✅ Installation completed"
- name: Cleanup After Installation (Mac)
if: matrix.os == 'mac'
shell: bash
run: |
# Mac cleanup
# Unmount the DMG
echo "Unmounting DMG..."
hdiutil detach "${{ env.MOUNT_POINT }}" -force
# Clean up temporary files
echo "Cleaning up temporary files..."
rm -rf "${{ env.DOWNLOAD_PATH }}"
rm -rf "${{ env.MOUNT_POINT }}"
echo "✅ Cleanup completed"
- name: Run QA Test Script (Mac)
if: matrix.os == 'mac'
shell: bash
run: |
Write-Host "Running QA Test script..."
python C:\viewer-sikulix-main\runTests.py
echo "Running QA Test script on Mac runner: ${{ matrix.runner }}..."
python "${{ matrix.install-path }}/runTests.py"
# - name: Upload Test Results
# uses: actions/upload-artifact@v3
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: test-results
# path: C:\viewer-sikulix-main\regressionTest\test_results.html
# name: test-results-${{ matrix.runner }}
# path: ${{ matrix.install-path }}/regressionTest/test_results.html

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}

Copilot Autofix

AI about 11 hours ago

To fix the issue, we will add a permissions block at the root level of the workflow to define the minimal permissions required. Based on the workflow's usage of the GITHUB_TOKEN (e.g., fetching artifacts), the contents: read permission is sufficient. This ensures that the token has only the necessary access to repository contents and no unnecessary write permissions.


Suggested changeset 1
.github/workflows/qatest.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/qatest.yaml b/.github/workflows/qatest.yaml
--- a/.github/workflows/qatest.yaml
+++ b/.github/workflows/qatest.yaml
@@ -2,2 +2,5 @@
 
+permissions:
+  contents: read
+
 on:
EOF
@@ -2,2 +2,5 @@

permissions:
contents: read

on:
Copilot is powered by AI and may make mistakes. Always verify output.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we already make this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants