From 62b4429dfe8e3812ef48f0d94fdd0efe1152d25e Mon Sep 17 00:00:00 2001 From: daniel Date: Sun, 15 Nov 2020 13:08:34 +0100 Subject: [PATCH] travis benchmarks --- .travis.yml | 5 ++++- .travis_bench.sh | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 .travis_bench.sh diff --git a/.travis.yml b/.travis.yml index 0b0608b..5f1af39 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,4 +3,7 @@ rust: - stable - beta - nightly - \ No newline at end of file +git: + depth: 10 +after_success: + ./.travis_bench.sh diff --git a/.travis_bench.sh b/.travis_bench.sh new file mode 100755 index 0000000..89bce0c --- /dev/null +++ b/.travis_bench.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# Clone the repository +REMOTE_URL="$(git config --get remote.origin.url)"; +cd ${TRAVIS_BUILD_DIR}/.. && \ +git clone ${REMOTE_URL} "${TRAVIS_REPO_SLUG}-bench" && \ +cd "${TRAVIS_REPO_SLUG}-bench" && \ + +# Bench master +git checkout master && \ +cargo bench -- --noplot --save-baseline before && \ + +# Bench current branch +git checkout ${TRAVIS_COMMIT} && \ +cargo bench -- --noplot --save-baseline after && \ + +# Install https://github.com/BurntSushi/critcmp +cargo install critcmp --force && \ + +# Compare the two generated benches +critcmp before after; \ No newline at end of file