Skip to content

Commit

Permalink
travis: always test the latest beta and nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
pietroalbini committed Mar 20, 2018
1 parent 70ce38d commit c7b5619
Showing 1 changed file with 27 additions and 15 deletions.
42 changes: 27 additions & 15 deletions .travis.yml
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

0 comments on commit c7b5619

Please sign in to comment.