@@ -196,3 +196,36 @@ jobs:
196
196
run : cargo +nightly update -Z minimal-versions
197
197
- name : Check MSRV for core with Rust ${{ env.rust_minver }}
198
198
run : cargo +${{ env.rust_minver }} check --locked --all-features --verbose
199
+
200
+ bench :
201
+ needs : [test, check]
202
+ strategy :
203
+ fail-fast : false
204
+ runs-on : ' ubuntu-latest'
205
+ steps :
206
+ - name : Checkout repository
207
+ uses : actions/checkout@v4
208
+ - name : Disable bench dependencies
209
+ run : ./.github/workflows/disable-bench-deps.sh
210
+ - name : Install Rust nightly
211
+ run : rustup toolchain install nightly
212
+ - name : Restore cargo caches
213
+ uses : Swatinem/rust-cache@v2
214
+ - name : Run benchmark
215
+ run : cargo +nightly bench --features "multi-thread,runtime-pattern" --bench spdlog_rs --bench spdlog_rs_pattern | tee bench-results.txt
216
+ - name : Discard irrelevant changes
217
+ run : git checkout -- spdlog/Cargo.toml
218
+ - name : Process results
219
+ uses : benchmark-action/github-action-benchmark@v1
220
+ with :
221
+ name : spdlog-rs on Linux
222
+ tool : cargo
223
+ output-file-path : bench-results.txt
224
+ benchmark-data-dir-path : docs/dev/benchmarks
225
+ github-token : ${{ secrets.GITHUB_TOKEN }}
226
+ summary-always : true
227
+ comment-on-alert : true
228
+ alert-comment-cc-users : ' @SpriteOvO'
229
+ - name : Push results to GitHub Pages branch
230
+ if : github.event_name != 'pull_request' && (github.ref_name == 'main' || github.ref_name == 'main-dev')
231
+ run : git push 'https://${{ github.repository_owner }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git' gh-pages:gh-pages
0 commit comments