Skip to content

Commit e299bb6

Browse files
vlaciqkaiser
authored andcommitted
ci: run cargo benchmark
1 parent 199d0c0 commit e299bb6

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

.github/workflows/CI.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,21 @@ jobs:
103103
SCCACHE_GHA_ENABLED: "true"
104104
RUSTC_WRAPPER: "sccache"
105105
run: cargo test
106+
- name: Run benchmark
107+
if: matrix.os == 'ubuntu-latest'
108+
env:
109+
SCCACHE_GHA_ENABLED: "true"
110+
RUSTC_WRAPPER: "sccache"
111+
run: cargo bench -- --output-format bencher | tee bench.txt
112+
- name: Store benchmark result
113+
if: matrix.os == 'ubuntu-latest'
114+
uses: benchmark-action/github-action-benchmark@v1
115+
with:
116+
tool: "cargo"
117+
output-file-path: bench.txt
118+
summary-always: true
119+
comment-on-alert: true
120+
github-token: ${{ secrets.GITHUB_TOKEN }}
106121

107122
build_linux_wheels:
108123
name: Build wheels (linux)

rust/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ crate-type = [
1212
"rlib", # for benchmarking
1313
]
1414
name = "unblob"
15+
# disable Rust nightly benchmark feature. We use criterion
16+
# https://bheisler.github.io/criterion.rs/book/faq.html#cargo-bench-gives-unrecognized-option-errors-for-valid-command-line-options
17+
bench = false
1518

1619
[dependencies]
1720
log = "0.4.22"

0 commit comments

Comments
 (0)