Skip to content

Commit a355a68

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 692a12c commit a355a68

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

.github/workflows/rust.yml

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
- name: Running test script
4646
env:
4747
DO_FMT: true
48+
DO_BENCH: true
4849
run: ./contrib/test.sh
4950

5051
MSRV:

contrib/test.sh

+12
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,16 @@ if [ "$MIN_VERSION" != true ]; then
6767
check "std arrayvec"
6868
fi
6969

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

0 commit comments

Comments
 (0)