[CI] Add lint stage

* Add scripts for Travis under ./scripts/travis
* Install rustfmt and clippy on nightly
* Lint code for formatting problems and common errors
pull/7/head
Florian Dehau 7 years ago
parent b351ad86e4
commit 29db3dd722

@ -1,9 +1,19 @@
language: rust
rust:
- stable
- beta
- nightly
cache: cargo
matrix:
allow_failures:
- rust: nightly
- rust: beta
before_script:
- NO_RUSTUP=1 ./scripts/travis/before_script.sh
script:
- NO_RUSTUP=1 ./scripts/travis/script.sh

@ -11,7 +11,11 @@ RUSTUP_INSTALLED = $(shell command -v rustup 2> /dev/null)
ifndef RUSTUP_INSTALLED
CARGO = cargo
else
CARGO = rustup run $(RUST_CHANNEL) cargo
ifdef NO_RUSTUP
CARGO = cargo
else
CARGO = rustup run $(RUST_CHANNEL) cargo
endif
endif

@ -0,0 +1,8 @@
#!/bin/bash
set -eu
export PATH="$PATH:$HOME/.cargo/bin"
if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
make install
fi

@ -0,0 +1,9 @@
#!/bin/bash
set -eu
make build
make test
if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then
make lint
fi
Loading…
Cancel
Save