From 6bc977b9e657d5a3b16f69caadb65ff2dd22922c Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Tue, 12 Mar 2019 22:26:01 +1100 Subject: [PATCH] Moved rustfmt commands after build, so that it passes. Also added clippy into CI checks, but allowing warnings to pass for now. --- .travis.yml | 3 ++- Dockerfile | 6 ++++-- Jenkinsfile | 13 +++++++------ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index d1d3836705..37416ed42a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,9 @@ before_install: - sudo chown $USER /usr/local/bin/protoc - sudo chown -R $USER /usr/local/include/google script: - - cargo fmt --all -- --check - cargo build --verbose --all + - cargo fmt --all -- --check + - cargo clippy - cargo test --verbose --all rust: - stable diff --git a/Dockerfile b/Dockerfile index 03e74a5127..6691efa971 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ FROM rust:latest -RUN rustup component add rustfmt - RUN apt-get update && apt-get install -y clang libclang-dev cmake build-essential git unzip autoconf libtool RUN git clone https://github.com/google/protobuf.git && \ @@ -17,3 +15,7 @@ RUN git clone https://github.com/google/protobuf.git && \ RUN mkdir /cargocache && chmod -R ugo+rwX /cargocache + +ENV CARGO_HOME /cargocache + +RUN rustup component add rustfmt clippy diff --git a/Jenkinsfile b/Jenkinsfile index 3377d4dc7a..da032ce5ba 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,20 +2,21 @@ pipeline { agent { dockerfile { filename 'Dockerfile' - args '-v cargo-cache:/cargocache:rw -e "CARGO_HOME=/cargocache"' + args '-v cargo-cache:/cargocache:rw' } } stages { - stage('Check') { - steps { - sh 'cargo fmt --all -- --check' - } - } stage('Build') { steps { sh 'cargo build' } } + stage('Check') { + steps { + sh 'cargo fmt --all -- --check' + sh 'cargo clippy' + } + } stage('Test') { steps { sh 'cargo test --all'