diff --git a/.travis.yml b/.travis.yml index d1d383670..37416ed42 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 03e74a512..6691efa97 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 3377d4dc7..da032ce5b 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'