Fix .travis.yml better

This commit is contained in:
Cecile Tonglet 2020-09-23 13:57:43 +02:00
parent 8cc26c0a52
commit d4e2213f1c

View file

@ -1,6 +1,4 @@
sudo: false
language: rust
cache: cargo
os:
- linux
@ -16,8 +14,8 @@ before_script:
# NOTE: will only run rustfmt and clippy if the branch is not main (and not for tags)
script:
- '[ "$TRAVIS_BRANCH" != main ] && [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && rustfmt --check **/*.rs'
- '[ "$TRAVIS_BRANCH" != main ] && [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ] && cargo clippy --all-targets --all-features -- -D warnings'
- 'if [ "$TRAVIS_BRANCH" != main ] && [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ]; then rustfmt --check **/*.rs; fi'
- '[ "$TRAVIS_BRANCH" != main ] && [ "$TRAVIS_BRANCH" != "$TRAVIS_TAG" ]; then cargo clippy --all-targets --all-features -- -D warnings; fi'
- cargo build
- cargo test
- cargo doc