forked from qTox/qTox
-
Notifications
You must be signed in to change notification settings - Fork 4
271 lines (243 loc) · 9.61 KB
/
startup-tests.yml
File metadata and controls
271 lines (243 loc) · 9.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
name: Startup Tests
on:
# push:
# paths-ignore:
# - 'README.md'
# schedule:
# - cron: '0 0 * * *'
workflow_dispatch:
inputs:
version:
description: dummy
default: dummy
defaults:
run:
shell: bash
jobs:
macos:
runs-on: macos-11
if: ${{ true }}
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: install cliclick
run: brew install cliclick
- name: install wget
run: brew install wget
- name: install sendkeys
run: brew install socsieng/tap/sendkeys
- name: macos-version1
run: sw_vers -productVersion
- name: macos-version2
run: system_profiler SPSoftwareDataType
- name: csrutil-status
run: csrutil status || exit 0
- name: notifications_off_01
run: launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist || exit 0
- name: notifications_off_02
run: killall NotificationCenter || exit 0
- name: startup-app
run: |
pwd
ls -al /Users/runner/
_HOME_="/Users/runner/"
cliclick -m verbose m:12,34
screencapture -T 1 -x -t png /Users/runner/screen01.png &
screencapture -T 2 -x -t png /Users/runner/screen02.png &
screencapture -T 3 -x -t png /Users/runner/screen03.png &
screencapture -T 10 -x -t png /Users/runner/screen04.png &
screencapture -T 25 -x -t png /Users/runner/screen05.png &
screencapture -T 50 -x -t png /Users/runner/screen06.png &
screencapture -T 60 -x -t png /Users/runner/screen07.png &
screencapture -T 90 -x -t png /Users/runner/screen09.png &
screencapture -T 110 -x -t png /Users/runner/screen10.png &
screencapture -T 200 -x -t png /Users/runner/screenshot-macos.png &
screencapture -T 230 -x -t png /Users/runner/screen12.png &
screencapture -T 300 -x -t png /Users/runner/screen13.png &
export _HOME_
cd "$_HOME_"
cd "$_SRC_"
mkdir -p /Users/runner/work/
cd /Users/runner/work/
wget "https://github.com/Zoxcore/qTox_enhanced/releases/download/nightly/qTox-nightly.dmg" -O qtox.dmg
hdiutil info
hdiutil attach /Users/runner/work/qtox.dmg
hdiutil info
cd /Volumes/qTox*
pwd
ls -al
echo '360497DA684BCE2A500C1AF9B3A5CE949BBB9F6FB1F91589806FB04CA039E313' | pbcopy
open ./qtox.app
pwd
sleep 20
sendkeys apps
sendkeys -a "qTox" -c "userm<c:enter>"
sleep 5
# osascript -e 'tell application "qTox" to activate'
sleep 10
sendkeys -a "qTox" -c "<c:u:command>"
sleep 5
sendkeys -a "qTox" -c "<c:u:ctrl>"
sleep 1
cliclick -m verbose c:706,608
sleep 60
sleep 90
sleep 120
pwd
ls -al /Users/runner/
cp -v /Users/runner/screenshot-macos.png /Users/runner/work/qTox_enhanced/qTox_enhanced/screenshot-macos.png
- name: upload-screenshots
uses: actions/upload-artifact@v5
with:
name: screenshot-macos
path: |
/Users/runner/screen*.png
- name: Upload to nightly release
uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/zoxcore/push_notification'
with:
allowUpdates: true
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "screenshot-macos.png"
linux-ub20:
runs-on: ubuntu-20.04
if: ${{ true }}
permissions:
contents: write
steps:
- name: os version
run: uname -a
- name: install deps
run: |
sudo apt-get update
sudo apt-get install imagemagick
sudo apt-get install xdotool xclip
sudo apt-get install x11-apps x11-utils
sudo apt-get install xvfb
- name: create runscript
run: |
printf '#!/bin/bash\n' > /tmp/a.sh
printf 'xclock -digital -geometry 300x45+100+600 &\n' >> /tmp/a.sh
printf 'xclip -selection c /tmp/g.txt\n' >> /tmp/a.sh
printf '/home/runner/work/qTox_enhanced/qTox_enhanced/squashfs-root/local/bin/qtox &\n' >> /tmp/a.sh
printf 'sleep 3\n' >> /tmp/a.sh
printf 'xdotool key u s e r l Return\n' >> /tmp/a.sh
printf 'sleep 5\n' >> /tmp/a.sh
printf 'xdotool key ctrl+u\n' >> /tmp/a.sh
printf 'xwininfo -id $(xdotool getactivewindow)\n' >> /tmp/a.sh
printf 'xdotool mousemove 512 386 click 1\n' >> /tmp/a.sh
printf 'sleep 120\n' >> /tmp/a.sh
printf 'import -window root /tmp/screenshot-linux.png\n' >> /tmp/a.sh
cat /tmp/a.sh
chmod a+rx /tmp/a.sh
echo '360497DA684BCE2A500C1AF9B3A5CE949BBB9F6FB1F91589806FB04CA039E313' > /tmp/g.txt
ls -al /tmp/g.txt
- name: startup-app
run: |
pwd
wget "https://github.com/Zoxcore/qTox_enhanced/releases/download/nightly/qTox-nightly.x86_64.AppImage" -O qtox.appimage
chmod a+rx qtox.appimage
./qtox.appimage --appimage-extract
pwd # /home/runner/work/qTox_enhanced/qTox_enhanced
xvfb-run --server-args="-screen 0 1024x768x24" --auto-servernum /tmp/a.sh
cp -av /tmp/screenshot-linux.png screenshot-linux.png
- name: upload-screenshots
uses: actions/upload-artifact@v5
with:
name: screenshot-linux
path: /tmp/screenshot-linux.png
- name: Upload to nightly release
uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/zoxcore/push_notification'
with:
allowUpdates: true
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "screenshot-linux.png"
windows:
runs-on: windows-latest
if: ${{ true }}
permissions:
contents: write
steps:
- name: Display the path
run: echo %PATH%
shell: cmd
- name: java-version
run: set -x ; "$JAVA_HOME_11_X64/bin/java.exe" -version
shell: bash
- name: install-app
run: |
curl.exe -L --output qtox.zip --url "https://github.com/Zoxcore/qTox_enhanced/releases/download/nightly/qtox-nightly-x86_64-Release.zip"
dir
tar -xf qtox.zip
dir
shell: cmd
- name: startup-app
shell: pwsh
run: |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
Start-Sleep -Seconds 30
Set-Clipboard -Value "360497DA684BCE2A500C1AF9B3A5CE949BBB9F6FB1F91589806FB04CA039E313"
Start-Process -FilePath "D:\a\qTox_enhanced\qTox_enhanced\qtox.exe" -WorkingDirectory "D:\a\qTox_enhanced\qTox_enhanced" -windowstyle Maximized
Start-Sleep -Seconds 20
[System.Windows.Forms.SendKeys]::SendWait("userw")
[System.Windows.Forms.SendKeys]::SendWait("{ENTER}")
Start-Sleep -Seconds 8
$signature=@'
[DllImport("user32.dll",CharSet=CharSet.Auto,CallingConvention=CallingConvention.StdCall)]
public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo);
'@
$SendMouseClick = Add-Type -memberDefinition $signature -name "Win32MouseEventNew" -namespace Win32Functions -passThru
$x = 650
$y = 544
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y)
sleep -Seconds 01
$SendMouseClick::mouse_event(0x00000002, 0, 0, 0, 0);
$SendMouseClick::mouse_event(0x00000004, 0, 0, 0, 0);
Start-Sleep -Seconds 180
- name: capture-screen
shell: pwsh
run: |
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$Screen = [System.Windows.Forms.SystemInformation]::VirtualScreen
$Width = $Screen.Width
$Height = $Screen.Height
$Left = $Screen.Left
$Top = $Screen.Top
$bitmap = New-Object System.Drawing.Bitmap $Width, $Height
$graphic = [System.Drawing.Graphics]::FromImage($bitmap)
$graphic.CopyFromScreen($Left, $Top, 0, 0, $bitmap.Size)
$bitmap.Save("D:\a\qTox_enhanced\qTox_enhanced\screenshot-windows.png")
Write-Output "Screenshot saved to:"
Write-Output D:\a\qTox_enhanced\qTox_enhanced\screenshot-windows.png
- name: upload-screenshots
uses: actions/upload-artifact@v5
with:
name: screenshot-windows
path: |
D:\a\qTox_enhanced\qTox_enhanced\screenshot-windows.png
- name: Upload to nightly release
uses: ncipollo/release-action@v1
if: github.ref == 'refs/heads/zoxcore/push_notification'
with:
allowUpdates: true
tag: nightly
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
prerelease: true
replacesArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: "screenshot-windows.png"