-
Notifications
You must be signed in to change notification settings - Fork 714
123 lines (102 loc) · 4.38 KB
/
windows-integration-test.yml
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
name: Windows CLI Integration Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Rust
run: |
Invoke-WebRequest https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-gnu/rustup-init.exe -OutFile rustup-init.exe
.\rustup-init.exe -y
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
override: true
cache: true
rustflags: ""
- name: Install Chocolatey
run: Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
- name: Install dependencies
shell: pwsh
run: |
choco install ffmpeg openssl
echo "C:\ProgramData\chocolatey\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install Scream on Windows
shell: powershell
run: |
Invoke-WebRequest https://github.com/duncanthrax/scream/releases/download/4.0/Scream4.0.zip -OutFile Scream4.0.zip
Expand-Archive -Path Scream4.0.zip -DestinationPath Scream
openssl req -batch -verbose -x509 -newkey rsa -keyout ScreamCertificate.pvk -out ScreamCertificate.cer -nodes -extensions v3_req
openssl pkcs12 -export -nodes -in ScreamCertificate.cer -inkey ScreamCertificate.pvk -out ScreamCertificate.pfx -passout pass:
- name: Setup MSVC Dev Cmd
uses: ilammy/msvc-dev-cmd@v1
- name: Sign and Install Scream Driver on Windows
shell: powershell
run: |
signtool sign /v /fd SHA256 /f ScreamCertificate.pfx Scream\Install\driver\x64\Scream.cat
Import-Certificate -FilePath ScreamCertificate.cer -CertStoreLocation Cert:\LocalMachine\root
Import-Certificate -FilePath ScreamCertificate.cer -CertStoreLocation Cert:\LocalMachine\TrustedPublisher
Scream\Install\helpers\devcon-x64.exe install Scream\Install\driver\x64\Scream.inf *Scream
timeout-minutes: 5
- name: Start Windows Audio Service
shell: powershell
run: net start audiosrv
- name: Build CLI
run: cargo build --release
- name: Run CLI and generate activity
shell: pwsh
run: |
$env:RUST_LOG = "debug"
$process = Start-Process -FilePath ".\target\release\screenpipe.exe" -ArgumentList "--debug" -PassThru -RedirectStandardOutput "screenpipe_output.log" -RedirectStandardError "screenpipe_error.log" -NoNewWindow
Start-Sleep -Seconds 10
# Generate some screen activity
for ($i = 0; $i -lt 5; $i++) {
Start-Process "notepad.exe"
Start-Sleep -Seconds 2
Stop-Process -Name "notepad" -Force
Start-Sleep -Seconds 2
}
# Generate some audio using PowerShell
[console]::beep(2000,1000)
Start-Sleep -Seconds 30 # Allow more time for processing
Stop-Process -Id $process.Id -Force
- name: Check for crashes and captured data
shell: pwsh
run: |
if (Select-String -Path "screenpipe_output.log" -Pattern "panic" -Quiet) {
Write-Host "CLI crashed"
Get-Content "screenpipe_output.log"
exit 1
}
Write-Host "CLI ran successfully without crashing"
$capturedFiles = Get-ChildItem -Path "$env:USERPROFILE\.screenpipe\data" -Recurse
if ($capturedFiles.Count -eq 0) {
Write-Host "No data was captured"
exit 1
}
Write-Host "Data captured successfully. File count: $($capturedFiles.Count)"
if (Select-String -Path "screenpipe_error.log" -Pattern "no audio devices available" -Quiet) {
Write-Host "Audio device setup failed"
exit 1
}
Get-Content "screenpipe_output.log" -Tail 100
Get-Content "screenpipe_error.log"
- name: Upload logs and data
uses: actions/upload-artifact@v4
if: always()
with:
name: windows-logs-and-data
path: |
screenpipe_output.log
screenpipe_error.log
${{ env.USERPROFILE }}\.screenpipe\data\