Skip to content

Commit 7af7b4b

Browse files
committed
Check formatting and clippy on CI builds
1 parent 51739de commit 7af7b4b

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
language: rust
22
rust:
3+
- 1.31.0
34
- stable
45
- beta
56
- nightly
67
matrix:
78
allow_failures:
89
- rust: nightly
10+
before_script:
11+
- rustup component add clippy
12+
- rustup component add rustfmt
13+
script: ci/script.sh
914
after_success:
1015
- if [ "$TRAVIS_RUST_VERSION" == "nightly" ]; then
1116
cargo bench;

ci/script.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
cargo build
6+
cargo test
7+
8+
# On Rust 1.31.0, we only care about passing tests.
9+
if [ ! rustc --version | grep "^rustc 1.31.0" ]; then
10+
cargo fmt --all -- --check
11+
cargo clippy -- -D warnings
12+
fi
13+
14+

0 commit comments

Comments
 (0)