-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
travis: always test the latest beta and nightly
- Loading branch information
1 parent
70ce38d
commit c7b5619
Showing
1 changed file
with
27 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,45 @@ | ||
sudo: false | ||
dist: trusty | ||
|
||
language: rust | ||
cache: cargo | ||
rust: | ||
- stable | ||
- nightly-2018-01-20 | ||
|
||
env: | ||
global: | ||
- RUSTFLAGS=-Dwarnings | ||
# Versions known to work with pinned nightly. | ||
# Versions known to work with pinned nightly for lints. | ||
- CLIPPY_VERSION=0.0.180 | ||
|
||
matrix: | ||
include: | ||
- env: TASK=test | ||
rust: stable | ||
- env: TASK=test | ||
rust: beta | ||
- env: TASK=lint | ||
rust: nightly-2018-01-20 | ||
allow_failures: | ||
- env: TASK=test | ||
rust: nightly | ||
|
||
before_script: | ||
- export PATH=$HOME/.cargo/bin:$PATH | ||
- | | ||
if ! type -p cargo-install-update; then | ||
cargo install --force cargo-update | ||
else | ||
cargo install-update -i cargo-update | ||
fi | ||
- | | ||
if [[ $TRAVIS_RUST_VERSION =~ nightly-* ]]; then | ||
if [[ $TASK = "lint" ]]; then | ||
if ! type -p cargo-install-update; then | ||
cargo install --force cargo-update | ||
else | ||
cargo install-update -i cargo-update | ||
fi | ||
rustup component add rustfmt-preview | ||
cargo install-update -i "clippy:$CLIPPY_VERSION" | ||
fi | ||
script: | ||
- | | ||
[[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || cargo fmt -- --write-mode diff | ||
- cargo build && cargo test | ||
- | | ||
[[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || cargo clippy | ||
if [[ $TASK = "lint" ]]; then | ||
cargo fmt -- --write-mode diff | ||
cargo clippy | ||
elif [[ $TASK = "test" ]]; then | ||
cargo build && cargo test | ||
fi |