fix: tests not working on CI#9
Conversation
divanshu-go
commented
Oct 18, 2025
|
@louis030195 Green build. |
| tesseract-install: winget install --id=UB-Mannheim.TesseractOCR -e --accept-package-agreements --accept-source-agreements | ||
| tesseract-install: | | ||
| winget install --id=UB-Mannheim.TesseractOCR -e --accept-package-agreements --accept-source-agreements | ||
| echo "C:\Program Files\Tesseract-OCR" >> $env:GITHUB_PATH |
There was a problem hiding this comment.
Previously, tesseract.exe was installed but not on the PATH, causing command-not-found errors in tests.
The new multi-line run step ensures both installation and path exposure are handled consistently on Windows runners.
| - name: Install additional dependencies | ||
| if: matrix.os == 'ubuntu-latest' | ||
| run: sudo apt-get update && sudo apt-get install -y pkg-config libdbus-1-dev libssl-dev libclang-dev libxcb1-dev libxrandr-dev libpipewire-0.3-dev libwayland-dev libegl-dev | ||
|
|
There was a problem hiding this comment.
Some crates (e.g. libxcap, wayshot, pipewire) link against system libraries unavailable in a clean Ubuntu runner.
Adding these packages prevents linker errors and ensures parity with local development environments.
| #[cfg(target_os = "macos")] | ||
| OcrProvider::MacOS => Ok(perform_ocr_apple(image, &self.options.languages)), | ||
| OcrProvider::MacOS => { | ||
| #[cfg(target_os = "macos")] | ||
| { | ||
| Ok(perform_ocr_apple(image, &self.options.languages)) | ||
| } | ||
| #[cfg(not(target_os = "macos"))] | ||
| { | ||
| Err(anyhow::anyhow!( | ||
| "macOS OCR is not available on this platform" | ||
| )) | ||
| } | ||
| } |
There was a problem hiding this comment.
The original implementation conditionally compiled the match arm, which caused missing-variant errors on non-macOS builds.
The updated approach keeps the variant present in all builds while using runtime cfg checks to control execution.
This prevents compilation issues and provides a clear runtime error if the macOS engine is selected on unsupported platforms.