Skip to content

Commit

Permalink
Rewrite of Travis CI script
Browse files Browse the repository at this point in the history
  • Loading branch information
kamarkiewicz committed Dec 4, 2017
1 parent 21c0f8c commit f5ee459
Showing 1 changed file with 40 additions and 29 deletions.
69 changes: 40 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,29 @@
language: rust

sudo: false
dist: trusty
cache: cargo

rust:
- nightly
- beta
- stable
- 1.2.0

env:
matrix:
- FEATURES=''
- FEATURES='' # default ones
- FEATURES='--features "regexp"'
- FEATURES='--features "regexp regexp_macros"'
- FEATURES='--features "regexp regexp_macros" --no-default-features'
- FEATURES='--features "stream regexp regexp_macros"'
- FEATURES='--features "stream regexp regexp_macros" --no-default-features'

before_script:
- if [ "$TRAVIS_RUST_VERSION" != "1.2.0" ]; then
cargo install cargo-travis --force && export PATH=$HOME/.cargo/bin:$PATH;
fi
matrix:
include:
- rust: nightly
env: FEATURES='--features "nightly regexp"'

script:
- '[ $TRAVIS_RUST_VERSION != 1.2.0 ] || cargo test --verbose --features "regexp"'
- '[ $TRAVIS_RUST_VERSION != nightly ] || cargo build --verbose --features "nightly regexp"'
- '[ $TRAVIS_RUST_VERSION == 1.2.0 ] || eval cargo test --verbose $FEATURES'
- '[ $TRAVIS_RUST_VERSION != nightly ] || cargo bench --verbose'
- '[ $TRAVIS_RUST_VERSION != stable ] || cargo doc --verbose --features "std regexp regexp_macros" --no-default-features'

after_success:
- '[ $TRAVIS_RUST_VERSION != nightly ] || cargo bench --verbose'
- '[ $TRAVIS_RUST_VERSION == 1.2.0 ] || cargo coveralls --verbose'
- '[ $TRAVIS_RUST_VERSION != nightly ] || cargo bench --verbose'
- if [ "${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" != "master" ] && [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then
cargo install cargo-benchcmp --force;
cargo bench > benches-variable;
git fetch;
git checkout master;
cargo bench > benches-control;
cargo benchcmp benches-control benches-variable;
fi
- rust: stable
env: DOC_FEATURES='--features "std stream regexp regexp_macros" --no-default-features'
script: eval cargo doc --verbose $DOC_FEATURES

notifications:
webhooks:
Expand All @@ -47,8 +33,6 @@ notifications:
on_failure: always
on_start: false

dist: trusty
sudo: false

addons:
apt:
Expand All @@ -60,3 +44,30 @@ addons:
- cmake
sources:
- kalakris-cmake

before_script: |
cargo install cargo-travis --force && export PATH=$HOME/.cargo/bin:$PATH
script:
- eval cargo build --verbose $FEATURES
- eval cargo test --verbose $FEATURES

after_success: |
case "$TRAVIS_RUST_VERSION" in
nightly)
cargo bench --verbose
cargo coveralls --verbose
cargo bench --verbose
if [ "${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" != "master" ]; then
cargo install cargo-benchcmp --force
cargo bench > benches-variable
git fetch
git checkout master
cargo bench > benches-control
cargo benchcmp benches-control benches-variable
fi
;;
*)
cargo coveralls --verbose
;;
esac

0 comments on commit f5ee459

Please sign in to comment.