From 97e3110333bce2a18a5f46917ba5ac497d11cfc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20Ker=C3=A4nen?= Date: Wed, 11 Oct 2017 20:11:19 +0300 Subject: [PATCH] Make Travis check that the code is correctly formatted Closes #99. --- .travis.yml | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index eeae8f8..9706331 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,38 @@ language: rust -rust: - - stable - - beta - - nightly +cache: cargo matrix: allow_failures: - rust: nightly include: + # Stable channel. + - os: linux + rust: stable + before_script: + - export PATH="$PATH:$HOME/.cargo/bin" + - which rustfmt || cargo install rustfmt + script: + - cargo fmt -- --write-mode=diff + - cargo build + - cargo test + # Beta channel. + - os: linux + rust: beta + - os: linux + rust: beta + env: TARGET=x86_64-unknown-linux-musl + - os: linux + rust: beta + env: TARGET=x86_64-unknown-linux-gnu # Nightly channel. + - os: linux + rust: nightly + before_script: + - export PATH="$PATH:$HOME/.cargo/bin" + - which rustfmt || cargo install rustfmt-nightly + script: + - cargo fmt -- --write-mode=diff + - cargo build + - cargo test - os: linux rust: nightly env: TARGET=i686-unknown-linux-musl @@ -17,13 +42,6 @@ matrix: - os: osx rust: nightly env: TARGET=x86_64-apple-darwin - # Beta channel. - - os: linux - rust: beta - env: TARGET=x86_64-unknown-linux-musl - - os: linux - rust: beta - env: TARGET=x86_64-unknown-linux-gnu # Minimum Rust supported channel. - os: linux rust: 1.16.0