Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

Fix CI: test compilation + Windows ORT/CRT linkage

Louis Beaumont6f0a9a2ca063
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 1c38bbb0a..4e6272dd4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -116,6 +116,27 @@ jobs:
with:
version: "10.0"
+ - name: Install 7zip
+ shell: powershell
+ run: |
+ $7zipUrl = "https://7-zip.org/a/7z2301-x64.exe"
+ $7zipInstaller = "7z-installer.exe"
+ Invoke-WebRequest -Uri $7zipUrl -OutFile $7zipInstaller
+ Start-Process -FilePath .\$7zipInstaller -Args "/S" -Wait
+ Remove-Item $7zipInstaller
+ echo "C:\Program Files\7-Zip" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+
+ - name: Download ONNX Runtime (CPU)
+ shell: pwsh
+ run: |
+ $url = "https://github.com/microsoft/onnxruntime/releases/download/v1.19.2/onnxruntime-win-x64-1.19.2.zip"
+ $zipFile = "onnxruntime-win-x64-1.19.2.zip"
+ $extractDir = "apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2"
+ Invoke-WebRequest -Uri $url -OutFile $zipFile
+ if (Test-Path $extractDir) { Remove-Item $extractDir -Recurse -Force }
+ 7z x $zipFile -o"apps/screenpipe-app-tauri/src-tauri/" -y
+ Write-Host "ONNX Runtime extracted to $extractDir"
+
- name: Run pre_build.js
shell: bash
run: bun ./scripts/pre_build.js
@@ -128,13 +149,28 @@ jobs:
cp crates/screenpipe-vision/tests/testing_OCR.png target/debug/deps/
- name: Run specific Windows OCR cargo test
- run: cargo test test_process_ocr_task_windows --release
+ env:
+ RUSTFLAGS: "-C target-feature=+crt-static -C link-arg=/LTCG"
+ ORT_STRATEGY: system
+ ORT_LIB_LOCATION: ${{ github.workspace }}/apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2
+ KNF_STATIC_CRT: 1
+ run: cargo test test_process_ocr_task_windows --release --target x86_64-pc-windows-msvc
- name: Run PII removal tests
- run: cargo test -p screenpipe-core pii_removal --release
+ env:
+ RUSTFLAGS: "-C target-feature=+crt-static -C link-arg=/LTCG"
+ ORT_STRATEGY: system
+ ORT_LIB_LOCATION: ${{ github.workspace }}/apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2
+ KNF_STATIC_CRT: 1
+ run: cargo test -p screenpipe-core pii_removal --release --target x86_64-pc-windows-msvc
- name: Run PII redaction tests
- run: cargo test -p screenpipe-server --lib pii_redaction_tests --release
+ env:
+ RUSTFLAGS: "-C target-feature=+crt-static -C link-arg=/LTCG"
+ ORT_STRATEGY: system
+ ORT_LIB_LOCATION: ${{ github.workspace }}/apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2
+ KNF_STATIC_CRT: 1
+ run: cargo test -p screenpipe-server --lib pii_redaction_tests --release --target x86_64-pc-windows-msvc
# pipes_test removed — pipe manager system deleted in #2212
diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml
index cb07670cb..2fa61a89d 100644
--- a/.github/workflows/e2e-test.yml
+++ b/.github/workflows/e2e-test.yml
@@ -145,12 +145,28 @@ jobs:
throw "No DLLs found in target directory!"
}
+ - name: Download ONNX Runtime (CPU)
+ shell: pwsh
+ run: |
+ $url = "https://github.com/microsoft/onnxruntime/releases/download/v1.19.2/onnxruntime-win-x64-1.19.2.zip"
+ $zipFile = "onnxruntime-win-x64-1.19.2.zip"
+ $extractDir = "apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2"
+ Invoke-WebRequest -Uri $url -OutFile $zipFile
+ if (Test-Path $extractDir) { Remove-Item $extractDir -Recurse -Force }
+ 7z x $zipFile -o"apps/screenpipe-app-tauri/src-tauri/" -y
+ Write-Host "ONNX Runtime extracted to $extractDir"
+
- name: Build CLI on Windows
shell: pwsh
env:
CARGO_PROFILE_RELEASE_STRIP: symbols
CARGO_PROFILE_RELEASE_PANIC: abort
CARGO_PROFILE_RELEASE_INCREMENTAL: false
+ RUSTFLAGS: "-C target-feature=+crt-static -C link-arg=/LTCG"
+ ORT_STRATEGY: system
+ ORT_LIB_LOCATION: ${{ github.workspace }}/apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2
+ VCPKG_STATIC_LINKAGE: "true"
+ KNF_STATIC_CRT: 1
run: cargo build --release -p screenpipe-server --target x86_64-pc-windows-msvc
- name: Install frontend dependencies
diff --git a/.github/workflows/windows-integration-test.yml b/.github/workflows/windows-integration-test.yml
index a8cd94261..5a8513fb0 100644
--- a/.github/workflows/windows-integration-test.yml
+++ b/.github/workflows/windows-integration-test.yml
@@ -56,6 +56,11 @@ jobs:
- name: Setup MSVC Dev Cmd
uses: ilammy/msvc-dev-cmd@v1
+ - name: Install LLVM and Clang
+ uses: KyleMayes/install-llvm-action@v2
+ with:
+ version: "10.0"
+
- name: Sign and Install Scream Driver on Windows
shell: powershell
run: |
@@ -65,14 +70,51 @@ jobs:
Scream\Install\helpers\devcon-x64.exe install Scream\Install\driver\x64\Scream.inf *Scream
timeout-minutes: 5
+ - name: Install 7zip
+ shell: powershell
+ run: |
+ $7zipUrl = "https://7-zip.org/a/7z2301-x64.exe"
+ $7zipInstaller = "7z-installer.exe"
+ Invoke-WebRequest -Uri $7zipUrl -OutFile $7zipInstaller
+ Start-Process -FilePath .\$7zipInstaller -Args "/S" -Wait
+ Remove-Item $7zipInstaller
+ echo "C:\Program Files\7-Zip" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
+
+ - name: Download ONNX Runtime (CPU)
+ shell: pwsh
+ run: |
+ $url = "https://github.com/microsoft/onnxruntime/releases/download/v1.19.2/onnxruntime-win-x64-1.19.2.zip"
+ $zipFile = "onnxruntime-win-x64-1.19.2.zip"
+ $extractDir = "apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2"
+ Invoke-WebRequest -Uri $url -OutFile $zipFile
+ if (Test-Path $extractDir) { Remove-Item $extractDir -Recurse -Force }
+ 7z x $zipFile -o"apps/screenpipe-app-tauri/src-tauri/" -y
+ Write-Host "ONNX Runtime extracted to $extractDir"
+
- name: Build CLI
- run: cargo build --release
+ env:
+ RUSTFLAGS: "-C target-feature=+crt-static -C link-arg=/LTCG"
+ ORT_STRATEGY: system
+ ORT_LIB_LOCATION: ${{ github.workspace }}/apps/screenpipe-app-tauri/src-tauri/onnxruntime-win-x64-1.19.2
+ VCPKG_STATIC_LINKAGE: "true"
+ KNF_STATIC_CRT: 1
+ run: cargo build --release --target x86_64-pc-windows-msvc
- 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
+ $exePath = if (Test-Path ".\target\x86_64-pc-windows-msvc\release\screenpipe.exe") {
+ ".\target\x86_64-pc-windows-msvc\release\screenpipe.exe"
+ } else {
+ ".\target\release\screenpipe.exe"
+ }
+ # Copy onnxruntime.dll next to the binary
+ $ortDll = "apps\screenpipe-app-tauri\src-tauri\onnxruntime-win-x64-1.19.2\lib\onnxruntime.dll"
+ if (Test-Path $ortDll) {
+ Copy-Item $ortDll (Split-Path $exePath) -Force
+ }
+ $process = Start-Process -FilePath $exePath -ArgumentList "--debug" -PassThru -RedirectStandardOutput "screenpipe_output.log" -RedirectStandardError "screenpipe_error.log" -NoNewWindow
Start-Sleep -Seconds 10
# Generate some screen activity
diff --git a/crates/screenpipe-server/tests/endpoint_test.rs b/crates/screenpipe-server/tests/endpoint_test.rs
index 99bcaeefa..4e33f6fbf 100644
--- a/crates/screenpipe-server/tests/endpoint_test.rs
+++ b/crates/screenpipe-server/tests/endpoint_test.rs
@@ -53,7 +53,7 @@ mod tests {
"balanced".to_string(),
);
- let router = app.create_router(true).await;
+ let router = app.create_router().await;
init();
(router, db)
}
diff --git a/crates/screenpipe-server/tests/tags_test.rs b/crates/screenpipe-server/tests/tags_test.rs
index ec6ed784d..ac164b474 100644
--- a/crates/screenpipe-server/tests/tags_test.rs
+++ b/crates/screenpipe-server/tests/tags_test.rs
@@ -43,7 +43,7 @@ async fn setup_test_app() -> (Router, Arc<DatabaseManager>) {
"balanced".to_string(),
);
- let router = app.create_router(true).await;
+ let router = app.create_router().await;
init();
(router, db)
}