Skip to content

Commit 87eb370

Browse files
committed
travis: always test the latest beta and nightly
1 parent 70ce38d commit 87eb370

File tree

1 file changed

+33
-15
lines changed

1 file changed

+33
-15
lines changed

.travis.yml

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,51 @@
11
sudo: false
22
dist: trusty
3+
34
language: rust
45
cache: cargo
5-
rust:
6-
- stable
7-
- nightly-2018-01-20
86

97
env:
108
global:
119
- RUSTFLAGS=-Dwarnings
12-
# Versions known to work with pinned nightly.
10+
# Versions known to work with pinned nightly for lints.
1311
- CLIPPY_VERSION=0.0.180
1412

13+
matrix:
14+
include:
15+
# Tests on all the channels
16+
- env: TASK=test
17+
rust: stable
18+
- env: TASK=test
19+
rust: beta
20+
- env: TASK=test
21+
rust: nightly
22+
23+
# Execute lints with the pinned nightly we know works.
24+
- env: TASK=lint
25+
rust: nightly-2018-01-20
26+
27+
# Don't block CI if a nightly is faulty
28+
allow_failures:
29+
- rust: nightly
30+
1531
before_script:
1632
- export PATH=$HOME/.cargo/bin:$PATH
1733
- |
18-
if ! type -p cargo-install-update; then
19-
cargo install --force cargo-update
20-
else
21-
cargo install-update -i cargo-update
22-
fi
23-
- |
24-
if [[ $TRAVIS_RUST_VERSION =~ nightly-* ]]; then
34+
if [[ $TASK = "lint" ]]; then
35+
if ! type -p cargo-install-update; then
36+
cargo install --force cargo-update
37+
else
38+
cargo install-update -i cargo-update
39+
fi
40+
2541
rustup component add rustfmt-preview
2642
cargo install-update -i "clippy:$CLIPPY_VERSION"
2743
fi
2844
script:
2945
- |
30-
[[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || cargo fmt -- --write-mode diff
31-
- cargo build && cargo test
32-
- |
33-
[[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || cargo clippy
46+
if [[ $TASK = "lint" ]]; then
47+
cargo fmt -- --write-mode diff
48+
cargo clippy
49+
elif [[ $TASK = "test" ]]; then
50+
cargo build && cargo test
51+
fi

0 commit comments

Comments
 (0)