Skip to content

Commit 34e6ab9

Browse files
committed
CI: Run benchmarks
We just added benchmarks to the crate, run them in CI when testing with the nightly toolchain.
1 parent 8f2bac7 commit 34e6ab9

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Diff for: .github/workflows/rust.yml

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
env:
4949
DO_DOCSRS: true
5050
DO_FMT: true
51+
DO_BENCH: true
5152
run: ./contrib/test.sh
5253

5354
MSRV:

Diff for: contrib/test.sh

+12
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,16 @@ if [ "${DO_DOCS-false}" = true ]; then
7171
RUSTDOCFLAGS="-D warnings" cargo +stable doc --all-features
7272
fi
7373

74+
# Bench if told to.
75+
if [ "${DO_BENCH-false}" = true ]
76+
then
77+
# Technically we could use beta too but we only run this in CI using nightly.
78+
if [ "$NIGHTLY" = false ]; then
79+
echo "DO_BENCH requires a nightly toolchain (consider using RUSTUP_TOOLCHAIN)"
80+
exit 1
81+
fi
82+
83+
RUSTFLAGS='--cfg=bench' cargo bench
84+
fi
85+
7486
exit 0

0 commit comments

Comments
 (0)