diff --git a/.travis.yml b/.travis.yml index e0cdd6d61..8a731af47 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,35 +1,51 @@ sudo: false dist: trusty + language: rust cache: cargo -rust: - - stable - - nightly-2018-01-20 env: global: - # Versions known to work with pinned nightly. - - CLIPPY_VERSION=0.0.180 - - RUSTFMT_VERSION=0.3.6 - -before_script: - - export PATH=$HOME/.cargo/bin:$PATH - - | - if ! type -p cargo-install-update; then - cargo install --force cargo-update - else - cargo install-update -i cargo-update - fi - - | - if [[ $TRAVIS_RUST_VERSION =~ nightly-* ]]; then - cargo install-update -i "clippy:$CLIPPY_VERSION" - cargo install-update -i "rustfmt-nightly:$RUSTFMT_VERSION" - fi -script: - - | - RUSTFLAGS=-Dwarnings cargo build && - cargo test - - | - [[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || RUSTFLAGS=-Dwarnings cargo fmt -- --write-mode diff - - | - [[ ! $TRAVIS_RUST_VERSION =~ nightly-* ]] || RUSTFLAGS=-Dwarnings cargo clippy + - RUSTFLAGS=-Dwarnings + + # Versions known to work with pinned nightly for lints. + - CLIPPY_VERSION=0.0.187 + +matrix: + include: + # Tests on all the channels + - env: TASK=test + rust: stable + - env: TASK=test + rust: beta + - env: TASK=test + rust: nightly + + # Execute lints with the pinned nightly we know works. + - env: TASK=lint + rust: nightly-2018-03-07 + + # Don't block CI if a nightly is faulty + fast_finish: true + allow_failures: + - rust: nightly + +before_script: | + if [[ $TASK = "lint" ]]; then + if ! type -p cargo-install-update; then + cargo install --force cargo-update + else + cargo install-update -i cargo-update + fi + + rustup component add rustfmt-preview + cargo install-update -i "clippy:$CLIPPY_VERSION" + fi + +script: | + if [[ $TASK = "lint" ]]; then + cargo fmt -- --write-mode diff + cargo clippy + elif [[ $TASK = "test" ]]; then + cargo build && cargo test + fi diff --git a/src/cli.rs b/src/cli.rs index 65d98d9e3..c563a5bce 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -70,7 +70,8 @@ pub enum Crater { env: DockerEnv, }, - #[structopt(name = "create-lists", about = "create all the lists of crates")] CreateLists, + #[structopt(name = "create-lists", about = "create all the lists of crates")] + CreateLists, #[structopt(name = "define-ex", about = "define an experiment")] DefineEx { @@ -107,10 +108,7 @@ pub enum Crater { }, #[structopt(name = "copy-ex", about = "copy all data from one experiment to another")] - CopyEx { - ex1: Ex, - ex2: Ex, - }, + CopyEx { ex1: Ex, ex2: Ex }, #[structopt(name = "delete-ex", about = "delete shared data for experiment")] DeleteEx { @@ -174,7 +172,8 @@ pub enum Crater { s3_prefix: Option, }, - #[structopt(name = "serve-report", about = "serve report")] Serve, + #[structopt(name = "serve-report", about = "serve report")] + Serve, } impl Crater { diff --git a/src/docker.rs b/src/docker.rs index 9c231ff01..7de638f0a 100644 --- a/src/docker.rs +++ b/src/docker.rs @@ -104,8 +104,8 @@ pub fn rust_container(config: RustEnv) -> ContainerConfig { ContainerConfig { image_name: IMAGE_NAME, - mounts: mounts, - env: env, + mounts, + env, } } diff --git a/src/ex.rs b/src/ex.rs index d42480868..b92a4cd48 100644 --- a/src/ex.rs +++ b/src/ex.rs @@ -136,9 +136,9 @@ pub fn define_(ex_name: &str, tcs: Vec, crates: Vec, mode: ExM ); let ex = Experiment { name: ex_name.to_string(), - crates: crates, + crates, toolchains: tcs, - mode: mode, + mode, }; fs::create_dir_all(&ex_dir(&ex.name))?; let json = serde_json::to_string(&ex)?; diff --git a/src/report/mod.rs b/src/report/mod.rs index 40fd23d75..d5f8444a2 100644 --- a/src/report/mod.rs +++ b/src/report/mod.rs @@ -63,7 +63,7 @@ pub fn generate_report(config: &Config, ex: &ex::Experiment) -> Result Result