fix #17
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: Rust Benchmark | |
on: [push] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
apple_ocr_benchmark: | |
name: Run Apple OCR benchmark | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Install dependencies | |
run: | | |
brew install ffmpeg | |
- name: Run OCR benchmarks | |
env: | |
DYLD_LIBRARY_PATH: ${{ github.workspace }}/screenpipe-vision/lib:${{ env.DYLD_LIBRARY_PATH }} | |
run: | | |
cargo bench --bench ocr_benchmark -- --output-format bencher | tee -a ocr_output.txt | |
- name: Upload OCR benchmark artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ocr-benchmark-data | |
path: ocr_output.txt | |
tesseract_ocr_benchmark: | |
name: Run Tesseract OCR benchmark | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libleptonica-dev libtesseract-dev tesseract-ocr-eng | |
- name: Run Tesseract OCR benchmarks | |
run: | | |
cargo bench --bench ocr_benchmark -- --output-format bencher | tee -a ocr_output.txt | |
- name: Upload OCR benchmark artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ocr-benchmark-data | |
path: ocr_output.txt | |
windows_ocr_benchmark: | |
name: Run Windows OCR benchmark | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Run Windows OCR benchmarks | |
run: | | |
cargo bench --bench ocr_benchmark -- --output-format criterion | Tee-Object -Append -FilePath ocr_output.txt | |
- name: Upload OCR benchmark artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ocr-benchmark-data | |
path: ocr_output.txt | |
analyze_benchmarks: | |
needs: [apple_ocr_benchmark, tesseract_ocr_benchmark, windows_ocr_benchmark] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download benchmark data | |
uses: actions/download-artifact@v3 | |
with: | |
name: ocr-benchmark-data | |
path: ./cache | |
- name: List contents of cache directory | |
run: ls -R ./cache | |
- name: Analyze all OCR benchmarks | |
uses: benchmark-action/github-action-benchmark@v1 | |
with: | |
name: OCR Benchmarks | |
tool: "cargo" | |
output-file-path: ./cache/ocr_output.txt | |
github-token: ${{ secrets.GH_PAGES_TOKEN }} | |
auto-push: true | |
alert-threshold: "200%" | |
comment-on-alert: true | |
fail-on-alert: true | |
alert-comment-cc-users: "@louis030195" |