Skip to content

Commit 6f69d02

Browse files
author
Mingshen Sun
committed
CI: add fmt and clippy check
cargo fmt is enforced, but clippy failures are allowed for now.
1 parent ef08064 commit 6f69d02

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

.travis.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ rust:
55
- stable
66
- nightly
77
env:
8-
- TARGET=x86_64-unknown-linux-gnu RUN_TEST=1
9-
- TARGET=x86_64-unknown-linux-musl RUN_TEST=1
8+
- TARGET=x86_64-unknown-linux-gnu TEST=1
9+
- TARGET=x86_64-unknown-linux-musl TEST=1
1010
- TARGET=aarch64-unknown-linux-gnu RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc"
1111
- TARGET=arm-unknown-linux-gnueabi RUSTFLAGS="-C linker=arm-linux-gnueabi-gcc"
1212
matrix:
@@ -25,6 +25,22 @@ matrix:
2525
script:
2626
- ./ci/run-cov
2727
- bash <(curl -s https://codecov.io/bash) -f final.info
28+
- rust: stable
29+
env: TARGET=x86_64-unknown-linux-gnu FMT=1
30+
before_install:
31+
install:
32+
before_script:
33+
- rustup component add rustfmt-preview
34+
script:
35+
- cargo fmt -- --write-mode check
36+
- rust: nightly
37+
env: TARGET=x86_64-unknown-linux-gnu CLIPPY=1
38+
before_install:
39+
install:
40+
before_script:
41+
- cargo +nightly install clippy
42+
script:
43+
- cargo clippy
2844
allow_failures:
2945
- rust: nightly
3046
fast_finish: true
@@ -39,7 +55,7 @@ before_script:
3955
script:
4056
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cargo build --verbose --no-default-features --features gnu,lsb,networking,posix --target $TARGET; fi
4157
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cargo build --verbose --all --target $TARGET; fi
42-
- if [[ "$RUN_TEST" == "1" ]]; then cargo test --verbose --all --target $TARGET; fi
58+
- if [[ "$TEST" == "1" ]]; then cargo test --verbose --all --target $TARGET; fi
4359
notifications:
4460
email:
4561
on_success: never

0 commit comments

Comments
 (0)