forked from tikv/raft-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
38 lines (33 loc) · 1.2 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
sudo: false
language: rust
os:
- linux
- windows
- osx
rust:
- stable
- nightly
# First Rust 2018 Stable. Officially the oldest compiler we support.
- 1.31.0
env:
global:
- RUST_BACKTRACE=1
- RUSTFLAGS="-D warnings"
# Inspired by https://levans.fr/rust_travis_cache.html
cache:
directories:
- /home/travis/.cargo
# But don't cache the cargo registry
before_cache:
- rm -rf /home/travis/.cargo/registry
install:
- if [[ $TRAVIS_RUST_VERSION == "stable" && $TRAVIS_OS_NAME == "linux" ]]; then rustup component add rustfmt; fi
- if [[ $TRAVIS_RUST_VERSION == "stable" && $TRAVIS_OS_NAME == "linux" ]]; then rustup component add clippy; fi
script:
- if [[ $TRAVIS_RUST_VERSION == "stable" && $TRAVIS_OS_NAME == "linux" ]]; then cargo fmt -- --check; fi
- if [[ $TRAVIS_RUST_VERSION == "stable" && $TRAVIS_OS_NAME == "linux" ]]; then cargo clippy -- -D clippy::all; fi
- cargo test --all -- --nocapture
# Validate benches still work.
- cargo bench --all -- --test
# Because failpoints inject failure in code path, which will affect all concurrently running tests, Hence they need to be synchronized, which make tests slow.
- cargo test --tests --features failpoint -- --nocapture