Package Startup Tests #8
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
name: Package 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-test-dmg: | |
runs-on: macos-11 | |
if: ${{ true }} | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 230 -x -t png /Users/runner/screen12.png & | |
screencapture -T 300 -x -t png /Users/runner/screenshot-macos-dmg.png & | |
export _HOME_ | |
cd "$_HOME_" | |
cd "$_SRC_" | |
mkdir -p /Users/runner/work/ | |
cd /Users/runner/work/ | |
wget "https://github.com/Zoxcore/trifa_material/releases/download/nightly/trifa-material_nightly.dmg" -O app.dmg | |
echo "--------1--------" | |
hdiutil info | |
echo "--------2--------" | |
hdiutil convert /Users/runner/work/app.dmg -format UDTO -o /Users/runner/work/app2.dmg | |
hdiutil attach /Users/runner/work/app2.dmg.cdr | |
echo "--------3--------" | |
hdiutil info | |
echo "--------4--------" | |
cd /Users/runner/work/ | |
echo "--------5--------" | |
ls -al /Volumes/ || echo "x" | |
echo "--------6--------" | |
ls -al /Volumes/trifa_material/ || echo "x" | |
echo "--------7--------" | |
ls -al /Volumes/trifa_material/trifa_material.app/ || echo "x" | |
echo "--------8--------" | |
/Volumes/trifa_material/trifa_material.app/Contents/MacOS/trifa_material & | |
pwd | |
sleep 60 | |
cliclick -m verbose m:12,34 | |
sleep 240 | |
cliclick -m verbose c:106,128 | |
sleep 10 | |
cliclick -m verbose c:139,124 | |
sleep 60 | |
sleep 90 | |
sleep 120 | |
pwd | |
ls -al /Users/runner/ | |
cp -v /Users/runner/screenshot-macos-dmg.png /Users/runner/work/trifa_material/trifa_material/package-screenshot-macos-dmg.png | |
- name: upload-screenshots | |
uses: actions/upload-artifact@v3 | |
with: | |
name: screenshot-macos | |
path: | | |
/Users/runner/screen*.png | |
- name: Upload to nightly release | |
uses: ncipollo/release-action@v1 | |
if: github.ref == 'refs/heads/master' | |
with: | |
allowUpdates: true | |
tag: nightly | |
omitBodyDuringUpdate: true | |
omitNameDuringUpdate: true | |
prerelease: true | |
replacesArtifacts: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: "package-screenshot-macos-dmg.png" | |
linux-test-deb: | |
runs-on: ubuntu-20.04 | |
if: ${{ true }} | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: install deps | |
run: | | |
sudo apt-get update | |
sudo apt-get install curl wget ca-certificates openjdk-17-jdk-headless openjdk-17-jdk | |
sudo apt-get install imagemagick | |
sudo apt-get install xdotool xclip | |
sudo apt-get install x11-apps x11-utils | |
sudo apt-get install lwm fvwm | |
sudo apt-get install xvfb | |
- name: download package | |
shell: bash | |
run: | | |
curl -L "https://github.com/Zoxcore/trifa_material/releases/download/nightly/trifa-material_nightly.deb" -o app.deb | |
pwd | |
ls -al | |
- name: install package | |
shell: bash | |
run: | | |
sudo dpkg -i ./app.deb | |
dpkg -L trifa-material | |
ls -al /opt/trifa-material/bin/trifa_material | |
file /opt/trifa-material/bin/trifa_material | |
- name: create runscript | |
run: | | |
printf '#!/bin/bash\n' > /tmp/a.sh | |
printf 'xclock -digital -geometry 300x45+100+688 &\n' >> /tmp/a.sh | |
printf '/opt/trifa-material/bin/trifa_material &\n' >> /tmp/a.sh | |
printf 'sleep 20\n' >> /tmp/a.sh | |
printf 'xwininfo -id $(xdotool getactivewindow)\n' >> /tmp/a.sh | |
printf 'xdotool mousemove --sync 80 74 click 1\n' >> /tmp/a.sh | |
printf 'sleep 2\n' >> /tmp/a.sh | |
printf 'xdotool mousemove --sync 140 74 click 1\n' >> /tmp/a.sh | |
printf 'pwd\n' >> /tmp/a.sh | |
printf 'sleep 5\n' >> /tmp/a.sh | |
printf 'ls -ratl\n' >> /tmp/a.sh | |
printf 'cat /home/runner/work/trifa_material/trifa_material/toxid.txt;echo\n' >> /tmp/a.sh | |
printf 'cd /home/runner/work/trifa_material/trifa_material/java_tox_tester-master/\n' >> /tmp/a.sh | |
printf './do_run.sh $(cat /home/runner/work/trifa_material/trifa_material/toxid.txt) >/dev/null 2>/dev/null &\n' >> /tmp/a.sh | |
printf 'sleep 220\n' >> /tmp/a.sh | |
printf 'xdotool mousemove --sync 214 295 click 1\n' >> /tmp/a.sh | |
printf 'sleep 40\n' >> /tmp/a.sh | |
printf 'fvwm2 &' >> /tmp/a.sh | |
printf 'sleep 20\n' >> /tmp/a.sh | |
printf 'import -window root /tmp/package-screenshot-linux-deb.png\n' >> /tmp/a.sh | |
cat /tmp/a.sh | |
chmod a+rx /tmp/a.sh | |
- name: startup-app | |
run: | | |
pwd | |
ls -al | |
xvfb-run --server-args="-screen 0 1024x768x24" --auto-servernum /tmp/a.sh | |
cp -av /tmp/package-screenshot-linux-deb.png package-screenshot-linux-deb.png | |
- name: upload-screenshots | |
uses: actions/upload-artifact@v3 | |
with: | |
name: screenshot-linux | |
path: /tmp/package-screenshot-linux-deb.png | |
- name: Upload to nightly release | |
uses: ncipollo/release-action@v1 | |
if: github.ref == 'refs/heads/master' | |
with: | |
allowUpdates: true | |
tag: nightly | |
omitBodyDuringUpdate: true | |
omitNameDuringUpdate: true | |
prerelease: true | |
replacesArtifacts: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: "package-screenshot-linux-deb.png" | |
windows-test-msi: | |
runs-on: windows-latest | |
if: ${{ true }} | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Display the path | |
run: echo %PATH% | |
shell: cmd | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' # See 'Supported distributions' for available options | |
java-version: '17' | |
- name: java-version | |
run: java -version | |
shell: bash | |
- name: download package | |
shell: bash | |
run: | | |
curl -L "https://github.com/Zoxcore/trifa_material/releases/download/nightly/trifa-material_nightly.msi" -o app.msi | |
pwd | |
ls -al | |
- name: list and install downloaded package | |
shell: pwsh | |
run: | | |
$file = "D:\a\trifa_material\trifa_material\app.msi" | |
$log = "install.log" | |
$procMain = Start-Process "msiexec" "/i `"$file`" /qn /l*! `"$log`"" -NoNewWindow -PassThru | |
$procLog = Start-Process "powershell" "Get-Content -Path `"$log`" -Wait" -NoNewWindow -PassThru | |
$procMain.WaitForExit() | |
$procLog.Kill() | |
dir "C:\Program Files\trifa_material\" | |
- name: list installed software | |
shell: pwsh | |
run: | | |
get-wmiobject Win32_Product | Format-Table IdentifyingNumber, Name | |
# C9814BA7-5321-378E-A20F-D3B0A2B2DED5 | |
- 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 | |
Start-Process -FilePath 'C:\Program Files\trifa_material\trifa_material.exe' -WorkingDirectory "D:\a\trifa_material\trifa_material" | |
Start-Sleep -Seconds 20 | |
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 = 84 | |
$y = 104 | |
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y) | |
sleep -Seconds 02 | |
$SendMouseClick::mouse_event(0x00000002, 0, 0, 0, 0); | |
$SendMouseClick::mouse_event(0x00000004, 0, 0, 0, 0); | |
sleep -Seconds 02 | |
$x = 146 | |
$y = 104 | |
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y) | |
$SendMouseClick::mouse_event(0x00000002, 0, 0, 0, 0); | |
$SendMouseClick::mouse_event(0x00000004, 0, 0, 0, 0); | |
Start-Sleep -Seconds 2 | |
- name: startup-app | |
shell: pwsh | |
run: | | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | |
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | |
$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 = 215 | |
$y = 325 | |
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y) | |
sleep -Seconds 02 | |
$SendMouseClick::mouse_event(0x00000002, 0, 0, 0, 0); | |
$SendMouseClick::mouse_event(0x00000004, 0, 0, 0, 0); | |
sleep -Seconds 02 | |
- 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\trifa_material\trifa_material\package-screenshot-windows-msi.png") | |
Write-Output "Screenshot saved to:" | |
Write-Output D:\a\trifa_material\trifa_material\package-screenshot-windows-msi.png | |
- name: upload-screenshots | |
uses: actions/upload-artifact@v3 | |
with: | |
name: screenshot-windows | |
path: | | |
D:\a\trifa_material\trifa_material\package-screenshot-windows-msi.png | |
- name: Upload to nightly release | |
uses: ncipollo/release-action@v1 | |
if: github.ref == 'refs/heads/master' | |
with: | |
allowUpdates: true | |
tag: nightly | |
omitBodyDuringUpdate: true | |
omitNameDuringUpdate: true | |
prerelease: true | |
replacesArtifacts: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: "package-screenshot-windows-msi.png" | |