Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trim down the Travis build #83

Merged
merged 1 commit into from
Jun 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 15 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ rust:
- beta
- nightly
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the first three builds are declared.


matrix:
include:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where the fourth build is declared.

- rust: nightly
env: BENCH=1

addons:
apt:
packages:
Expand All @@ -20,27 +25,20 @@ before_script:
export PATH=$HOME/.local/bin:$PATH

script:
# TEMPORARY UNTIL SERDE 0.7 IS RELEASED
- |
mkdir .travis-deps
mkdir .cargo
echo 'paths = ["./.travis-deps/serde"]' > .cargo/config
git clone https://github.com/serde-rs/serde .travis-deps/serde
pushd .travis-deps/serde
git reset --hard origin/master
popd
- |
(cd json && travis-cargo build) &&
(cd json && travis-cargo test) &&
(cd json_tests && travis-cargo test -- --features with-syntex --no-default-features) &&
(cd json_tests && travis-cargo --only nightly test -- features nightly-testing) &&
(cd json_tests && travis-cargo --only nightly bench -- features nightly-testing) &&
(cd json_tests && travis-cargo --only nightly bench -- --features "nightly-testing with-syntex" --no-default-features) &&
(cd json && travis-cargo --only stable doc)
if [ -z $BENCH ]; then
Copy link
Member

@oli-obk oli-obk Jun 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't speak bash... What does the -z do, and why is the bench flag set to 1 on nightly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-z means empty i.e. BENCH.len() == 0. We run four builds: the three release channels stable beta and nightly, and a fourth one that is nightly with an environment variable BENCH=1. The bench build was the longest so I split it out into it's own build to increase parallelism. The stable/beta/nightly builds all run the first part of this if statement. The BENCH=1 build runs the second part which is just travis-cargo bench.

(cd json && travis-cargo build) &&
(cd json && travis-cargo --only nightly test) &&
(cd json_tests && travis-cargo --skip nightly test -- --features with-syntex --no-default-features) &&
(cd json_tests && travis-cargo --only nightly test -- --features nightly-testing) &&
(cd json && travis-cargo --only stable doc)
else
(cd json_tests && travis-cargo bench)
fi

after_success:
- (cd json && travis-cargo --only stable doc-upload)
- (cd json_tests && travis-cargo coveralls --no-sudo)
- (cd json_tests && travis-cargo --only stable coveralls --no-sudo)

env:
global:
Expand Down