Skip to content

Commit ecb0880

Browse files
Add screenshot publishing workflow and update CI
Introduces a new GitHub Actions workflow to publish screenshots after successful CI runs. Also updates the Windows configuration step in the CI workflow to minimize all windows before running tests.
1 parent 4b989ab commit ecb0880

2 files changed

Lines changed: 82 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,24 +136,39 @@ jobs:
136136
working-directory: build/tests
137137
run: ./test_tray --gtest_color=yes --gtest_filter=TrayTest.TestTrayInit
138138

139-
- name: Configure Windows Tray and Notifications
139+
- name: Configure Windows
140140
if: runner.os == 'Windows'
141141
shell: pwsh
142142
run: |
143-
# Enable all tray icons
143+
echo "::group::Enable all tray icons"
144144
Invoke-WebRequest `
145145
-Uri "https://raw.githubusercontent.com/paulmann/windows-show-all-tray-icons/main/Enable-AllTrayIcons.ps1" `
146146
-OutFile "Enable-AllTrayIcons.ps1"
147147
.\Enable-AllTrayIcons.ps1 -Action Enable -Force # Enable with comprehensive method (resets ALL icon settings)
148+
echo "::endgroup::"
148149
149-
# Disable Do Not Disturb
150-
$quietHoursPath = "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\QuietHours"
151-
New-Item -Path $quietHoursPath -Force | Out-Null
152-
Set-ItemProperty -Path $quietHoursPath -Name "Enabled" -Value 0
153-
Set-ItemProperty -Path $quietHoursPath -Name "Profile" -Value "Unrestricted"
150+
echo "::group::Disable Do Not Disturb"
151+
Add-Type -AssemblyName System.Windows.Forms
152+
Start-Process "ms-settings:notifications"
153+
Start-Sleep -Seconds 2
154+
[System.Windows.Forms.SendKeys]::SendWait("{TAB}")
155+
[System.Windows.Forms.SendKeys]::SendWait("{TAB}")
156+
[System.Windows.Forms.SendKeys]::SendWait(" ")
157+
echo "::endgroup::"
154158
155-
# Restart notification services
156-
Get-Service -Name "WpnUserService_*" | Restart-Service -Force
159+
echo "::group::Disable Quiet Hours"
160+
Set-ItemProperty `
161+
-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings" `
162+
-Name "QuietHours" `
163+
-Type DWord `
164+
-Value 0
165+
Start-Process "gpupdate.exe" -ArgumentList "/force" -Wait
166+
echo "::endgroup::"
167+
168+
echo "::group::Minimize all windows"
169+
$shell = New-Object -ComObject Shell.Application
170+
$shell.MinimizeAll()
171+
echo "::endgroup::"
157172
158173
- name: Run tests
159174
id: test
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: Publish Screenshots
3+
4+
on:
5+
workflow_run:
6+
workflows: ["CI"]
7+
types:
8+
- completed
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
publish:
16+
if: github.event.workflow_run.conclusion == 'success'
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Download Artifacts
20+
uses: actions/download-artifact@v7
21+
with:
22+
path: screenshots
23+
pattern: tray-screenshots-*
24+
run-id: ${{ github.event.workflow_run.id }}
25+
26+
- name: Debug screenshots
27+
run: ls -R screenshots
28+
29+
- name: Determine Branch and Path
30+
id: determine
31+
env:
32+
PULL_REQUEST_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }}
33+
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
34+
run: |
35+
if [ -n "${PULL_REQUEST_NUMBER}" ]; then
36+
PR_NUMBER=${PULL_REQUEST_NUMBER}
37+
BRANCH_PATH="PR-${PULL_REQUEST_NUMBER}"
38+
is_pr=true
39+
else
40+
BRANCH_NAME=$(echo "${HEAD_BRANCH}" | sed 's/\//-/g')
41+
BRANCH_PATH="${BRANCH_NAME}"
42+
is_pr=false
43+
fi
44+
45+
{
46+
echo "branch_path=${BRANCH_PATH}"
47+
echo "is_pr=${is_pr}"
48+
echo "pr_number=${PR_NUMBER}"
49+
} >> "${GITHUB_OUTPUT}"
50+
51+
# debug outputs
52+
cat "${GITHUB_OUTPUT}"
53+
54+
- name: Checkout Screenshots Branch
55+
uses: actions/checkout@v6
56+
with:
57+
ref: screenshots
58+
path: screenshots-repo

0 commit comments

Comments
 (0)