forked from tikv/raft-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
44 lines (39 loc) · 1.59 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
39
40
41
42
43
44
sudo: false
language: rust
os: linux
rust:
- stable
- nightly
# Officially the oldest compiler we support.
- 1.39.0
matrix:
include:
- os: windows
rust: stable
- os: osx
rust: stable
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 --all -- --check; fi
- if [[ $TRAVIS_RUST_VERSION == "stable" && $TRAVIS_OS_NAME == "linux" ]]; then cargo clippy --all --all-targets -- -D clippy::all; fi
- if [[ $TRAVIS_RUST_VERSION == "stable" && $TRAVIS_OS_NAME == "linux" ]]; then cargo clippy --no-default-features --features prost-codec -- -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 failpoints -- --nocapture
# TODO: There is a bug in protobuf-build that cached size is not supported yet, so do not test harness.
- cargo test --no-default-features --features prost-codec -- --nocapture