Skip to content

Commit

Permalink
CI: Run benchmarks
Browse files Browse the repository at this point in the history
We just added benchmarks to the crate, run them in CI when testing with
the nightly toolchain.
  • Loading branch information
tcharding committed Apr 3, 2023
1 parent 692a12c commit a355a68
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
- name: Running test script
env:
DO_FMT: true
DO_BENCH: true
run: ./contrib/test.sh

MSRV:
Expand Down
12 changes: 12 additions & 0 deletions contrib/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,16 @@ if [ "$MIN_VERSION" != true ]; then
check "std arrayvec"
fi

# Bench if told to.
if [ "$DO_BENCH" = true ]
then
# Technically we could use beta too but we only run this in CI using nightly.
if [ "$NIGHTLY" = false ]; then
echo "DO_BENCH requires a nightly toolchain (consider using RUSTUP_TOOLCHAIN=nightly)"
exit 1
fi

RUSTFLAGS='--cfg=bench' cargo bench
fi

exit 0

0 comments on commit a355a68

Please sign in to comment.