From 08f15517f292e9f90f16cce3c022ca521f3204d1 Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Tue, 12 Mar 2019 19:45:58 +1100 Subject: [PATCH 1/6] Added rustfmt check to Jenkins build, and moved to top of Travis build. --- .travis.yml | 2 +- Jenkinsfile | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d43d21a00..d1d383670 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,9 +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 test --verbose --all - - cargo fmt --all -- --check rust: - stable - beta diff --git a/Jenkinsfile b/Jenkinsfile index 42755d5f7..3377d4dc7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,6 +6,11 @@ pipeline { } } stages { + stage('Check') { + steps { + sh 'cargo fmt --all -- --check' + } + } stage('Build') { steps { sh 'cargo build' From 197cd6341dc18f06f581722b48a28f88e3426760 Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Tue, 12 Mar 2019 19:54:52 +1100 Subject: [PATCH 2/6] Installed rustfmt in Dockerfile. --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 063ece3cd..03e74a512 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ 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 && \ From 6bc977b9e657d5a3b16f69caadb65ff2dd22922c Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Tue, 12 Mar 2019 22:26:01 +1100 Subject: [PATCH 3/6] 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 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' From ed5f6971189afe2c60d7fee455c2177cd1d5872f Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Tue, 12 Mar 2019 22:36:20 +1100 Subject: [PATCH 4/6] Added clippy component installation to Travis CI yml file. --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 37416ed42..0d520aabb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,3 +21,4 @@ matrix: fast_finish: true install: - rustup component add rustfmt + - rustup component add clippy From 6d5bba1dcca492780526deec2f806bee6eb0ea14 Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Thu, 21 Mar 2019 16:08:14 +1100 Subject: [PATCH 5/6] Commenting out clippy, since he's not coming until later. --- .travis.yml | 3 ++- Jenkinsfile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0d520aabb..b6cab3466 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,8 @@ before_install: script: - cargo build --verbose --all - cargo fmt --all -- --check - - cargo clippy + # No clippy until later... + #- cargo clippy - cargo test --verbose --all rust: - stable diff --git a/Jenkinsfile b/Jenkinsfile index da032ce5b..e217a6130 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,8 @@ pipeline { stage('Check') { steps { sh 'cargo fmt --all -- --check' - sh 'cargo clippy' + // No clippy until later... + //sh 'cargo clippy' } } stage('Test') { From da219ffd1020c24a8b2316fa2246ec45aa0496d2 Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Mon, 25 Mar 2019 16:13:46 +1100 Subject: [PATCH 6/6] Added cargo cache back into it. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index e217a6130..0401c0df5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent { dockerfile { filename 'Dockerfile' - args '-v cargo-cache:/cargocache:rw' + args '-v cargo-cache:/cargocache:rw -e "CARGO_HOME=/cargocache"' } } stages {