Package Startup Tests #2
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: | |
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.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.png /Users/runner/work/trifa_material/trifa_material/package-screenshot-macos.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.png" | |
windows-test: | |
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.png") | |
Write-Output "Screenshot saved to:" | |
Write-Output D:\a\trifa_material\trifa_material\package-screenshot-windows.png | |
- name: upload-screenshots | |
uses: actions/upload-artifact@v3 | |
with: | |
name: screenshot-windows | |
path: | | |
D:\a\trifa_material\trifa_material\package-screenshot-windows.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.png" | |