#!/usr/bin/env bash
# Credit
# - https://beachape.com/blog/2016/11/02/rust-performance-testing-on-travis-ci/
# - http://sunjay.ca/2017/04/27/rust-benchmark-comparison-travis
if [ && [; then
REMOTE_URL=""
# Clone the repository fresh..for some reason checking out master fails
# from a normal PR build's provided directory
# The Travis environment variables behave like so:
# TRAVIS_BRANCH
# - if PR build, this is the pr base branch
# - if push build, this is the branch that was pushed
# TRAVIS_PULL_REQUEST_BRANCH
# - if PR build, this is the "target" of the pr, i.e. not the base branch
# - if push build, this is blank
#
# Example:
# You open a PR with base `master`, and PR branch `foo`
# During a PR build:
# TRAVIS_BRANCH=master
# TRAVIS_PULL_REQUEST_BRANCH=foo
# During a push build:
# TRAVIS_BRANCH=foo
# TRAVIS_PULL_REQUEST_BRANCH=
# Bench the pull request base or master
if [; then
else # this is a push build
# This could be replaced with something better like asking git which
# branch is the base of $TRAVIS_BRANCH
fi
|
# Bench the current commit that was pushed
|
fi