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
name: Benchmarks
on:
workflow_dispatch:
push:
branches:
- main
paths:
- Cargo.toml
- Cargo.lock
- benches/**
- src/**
- examples/**
jobs:
benchmark:
name: Criterion Benchmarks
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
- name: Run Criterion benchmarks
run: cargo bench --bench performance
- name: Upload Criterion reports
uses: actions/upload-artifact@v4
with:
name: criterion-report
path: target/criterion
if-no-files-found: error
- name: Write workflow summary
run: |
echo "## Benchmark Run" >> $GITHUB_STEP_SUMMARY
echo "Criterion reports were uploaded as the \\`criterion-report\\` artifact." >> $GITHUB_STEP_SUMMARY
echo "See BENCHMARKS.md for guidance on interpreting regressions." >> $GITHUB_STEP_SUMMARY