-
Notifications
You must be signed in to change notification settings - Fork 715
146 lines (123 loc) · 4.21 KB
/
benchmark.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
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@v4
- 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@v4
with:
name: apple-ocr-benchmark-data
path: ocr_output.txt
tesseract_ocr_benchmark:
name: Run Tesseract OCR benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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@v4
with:
name: tesseract-ocr-benchmark-data
path: ocr_output.txt
windows_ocr_benchmark:
name: Run Windows OCR benchmark
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Run Windows OCR benchmarks
run: |
cargo bench --bench ocr_benchmark -- --output-format criterion
# TODO broken
# | Tee-Object -Append -FilePath ocr_output.txt
- name: Upload OCR benchmark artifact
uses: actions/upload-artifact@v4
with:
name: windows-ocr-benchmark-data
path: ocr_output.txt
stt_benchmark:
name: Run STT benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg tesseract-ocr libtesseract-dev libavformat-dev libavfilter-dev libavdevice-dev ffmpeg libasound2-dev libgtk-3-dev libsoup-3.0-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev
- name: Run STT benchmarks
run: |
cargo bench --bench stt_benchmark -- --output-format bencher | tee -a stt_output.txt
- name: Upload STT benchmark artifact
uses: actions/upload-artifact@v4
with:
name: stt-benchmark-data
path: stt_output.txt
analyze_benchmarks:
needs:
[
apple_ocr_benchmark,
tesseract_ocr_benchmark,
windows_ocr_benchmark,
stt_benchmark,
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download benchmark data
uses: actions/download-artifact@v3
with:
path: ./cache/ocr
- name: Download STT benchmark data
uses: actions/download-artifact@v3
with:
name: stt-benchmark-data
path: ./cache/stt
- name: List contents of cache directory
run: ls -R ./cache
- name: Analyze OCR benchmarks
uses: benchmark-action/github-action-benchmark@v1
with:
name: OCR Benchmarks
tool: "cargo"
output-file-path: ./cache/ocr/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"
# todo broken
# - name: Analyze STT benchmarks
# uses: benchmark-action/github-action-benchmark@v1
# with:
# name: STT Benchmarks
# tool: "cargo"
# output-file-path: ./cache/stt/stt_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"