From 3a88ea3996ca5793378ba2a94832bfc79fb4a513 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sun, 20 Sep 2020 19:05:33 +0200 Subject: [PATCH] Add .travis.yml --- .travis.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..813cde9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,25 @@ +sudo: false +language: rust +cache: cargo +os: + - linux + +rust: + - stable + +# NOTE: disable Travis' cache for now because it makes the Windows build fail +cache: + directories: + +before_script: + - rustup component add rustfmt-preview clippy + +# 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 + - cargo build + - cargo test + - cargo doc