mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-08-07 18:36:34 +00:00
test(tray): add system tray tests (#4221)
This commit is contained in:
@@ -151,17 +151,20 @@ jobs:
|
||||
|
||||
./appimagelint-x86_64.AppImage ./artifacts/sunshine.AppImage
|
||||
|
||||
- name: Install test deps
|
||||
- name: Install screenshot dependency
|
||||
run: |
|
||||
sudo apt-get update -y
|
||||
sudo apt-get install -y \
|
||||
x11-xserver-utils \
|
||||
xvfb
|
||||
sudo apt-get install -y imagemagick
|
||||
|
||||
# clean apt cache
|
||||
sudo apt-get clean
|
||||
sudo rm -rf /var/lib/apt/lists/*
|
||||
|
||||
- name: Setup virtual desktop
|
||||
uses: LizardByte/actions/actions/virtual_desktop@d0ae7f82215a479fe2b74f4088c53ee6460513dd # v2026.728.214955
|
||||
with:
|
||||
environment: mate
|
||||
|
||||
- name: Setup python
|
||||
id: python
|
||||
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
||||
@@ -182,12 +185,17 @@ jobs:
|
||||
- name: Run tests
|
||||
id: test
|
||||
working-directory: build/tests
|
||||
run: |
|
||||
export DISPLAY=:1
|
||||
Xvfb ${DISPLAY} -screen 0 1024x768x24 &
|
||||
sleep 5 # give Xvfb time to start
|
||||
run: ./test_sunshine --gtest_color=yes --gtest_output=xml:test_results.xml
|
||||
|
||||
./test_sunshine --gtest_color=yes --gtest_output=xml:test_results.xml
|
||||
- name: Upload system tray screenshots
|
||||
if: >-
|
||||
always() &&
|
||||
(steps.test.outcome == 'success' || steps.test.outcome == 'failure')
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: sunshine-screenshots-${{ matrix.name }}
|
||||
path: build/tests/screenshots
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Generate gcov report
|
||||
id: test_report
|
||||
|
||||
@@ -94,6 +94,9 @@ jobs:
|
||||
qtbase \
|
||||
qtsvg
|
||||
|
||||
- name: Configure macOS screen recording
|
||||
uses: LizardByte/tray/.github/actions/configure-macos-screen-recording@master
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
||||
with:
|
||||
@@ -182,6 +185,16 @@ jobs:
|
||||
working-directory: build/tests
|
||||
run: ./test_sunshine --gtest_color=yes --gtest_output=xml:test_results.xml
|
||||
|
||||
- name: Upload system tray screenshots
|
||||
if: >-
|
||||
always() &&
|
||||
(steps.test.outcome == 'success' || steps.test.outcome == 'failure')
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: sunshine-screenshots-${{ matrix.name }}
|
||||
path: build/tests/screenshots
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Generate gcov report
|
||||
id: test_report
|
||||
# any except canceled or skipped
|
||||
|
||||
@@ -348,12 +348,34 @@ jobs:
|
||||
shell: msys2 {0}
|
||||
run: cat ./build/cpack_artifacts/_CPack_Packages/win64/WIX/wix.log || true
|
||||
|
||||
- name: Initialize tray icon
|
||||
working-directory: build/tests
|
||||
env:
|
||||
SUNSHINE_CONFIGURE_TRAY_ICONS: '1'
|
||||
run: >-
|
||||
./test_sunshine.exe
|
||||
--gtest_color=yes
|
||||
--gtest_filter=SystemTrayTest.InitializesTrayForWorkflowConfiguration
|
||||
|
||||
- name: Configure Windows tray screenshots
|
||||
uses: LizardByte/tray/.github/actions/configure-windows-tray-screenshots@master
|
||||
|
||||
- name: Run tests
|
||||
id: test
|
||||
shell: msys2 {0}
|
||||
working-directory: build/tests
|
||||
run: ./test_sunshine.exe --gtest_color=yes --gtest_output=xml:test_results.xml
|
||||
|
||||
- name: Upload system tray screenshots
|
||||
if: >-
|
||||
always() &&
|
||||
(steps.test.outcome == 'success' || steps.test.outcome == 'failure')
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: sunshine-screenshots-${{ matrix.name }}
|
||||
path: build/tests/screenshots
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Generate gcov report
|
||||
id: test_report
|
||||
# any except canceled or skipped
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
name: Publish Screenshots
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["CI"]
|
||||
types:
|
||||
- completed
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
if: github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure'
|
||||
permissions:
|
||||
actions: read
|
||||
contents: write
|
||||
pull-requests: write
|
||||
statuses: write
|
||||
uses: LizardByte/tray/.github/workflows/_publish-screenshots.yml@master
|
||||
with:
|
||||
artifact-name-prefix: sunshine-screenshots-
|
||||
source-run-id: ${{ github.event.workflow_run.id }}
|
||||
Reference in New Issue
Block a user