From dde4b89369cc901c7e242a44265099f27bce1698 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Tue, 3 Sep 2019 10:09:05 +0300 Subject: [PATCH] Make Travis cfg pretty and modular (#118) --- .travis.yml | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9d78f7f..260a753 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,44 @@ language: rust +env: RUSTFLAGS="-D warnings" + matrix: fast_finish: true include: - rust: nightly os: linux - env: RUSTFLAGS="-D warnings" BUILD_DOCS=1 BUILD_BOOK=1 + - rust: nightly os: osx osx_image: xcode9.2 - env: RUSTFLAGS="-D warnings" BUILD_DOCS=1 + - rust: nightly-x86_64-pc-windows-msvc os: windows - env: RUSTFLAGS="-D warnings" -before_script: - - rustup component add rustfmt - - if [[ -n "$BUILD_BOOK" ]]; then (test -x $HOME/.cargo/bin/mdbook || ./ci/install-mdbook.sh); fi + - name: fmt + rust: nightly + os: linux + before_script: + - rustup component add rustfmt + script: + - cargo fmt --all -- --check + + - name: docs + rust: nightly + os: linux + script: + - cargo doc --features docs + + - name: book + rust: nightly + os: linux + before_script: + - test -x $HOME/.cargo/bin/mdbook || ./ci/install-mdbook.sh + - cargo build # to find 'extern crate async_std' by `mdbook test` + script: + - mdbook build docs + - mdbook test -L ./target/debug/deps docs script: - - if ! [[ -n "$BUILD_BOOK" ]]; then cargo check --features unstable --all --benches --bins --examples --tests && cargo test --features unstable --all; fi - - if [[ -n "$BUILD_BOOK" ]]; then cargo test --features unstable --all --benches --bins --examples --tests; fi - - cargo fmt --all -- --check - - if [[ -n "$BUILD_DOCS" ]]; then cargo doc --features docs; fi - - if [[ -n "$BUILD_BOOK" ]]; then mdbook build docs && mdbook test -L ./target/debug/deps docs; fi + - cargo check --features unstable --all --benches --bins --examples --tests + - cargo test --features unstable --all