Moved rustfmt commands after build, so that it passes.

Also added clippy into CI checks, but allowing warnings to pass for now.
This commit is contained in:
Luke Anderson 2019-03-12 22:26:01 +11:00
parent 5c20e2272f
commit 6bc977b9e6
No known key found for this signature in database
GPG Key ID: 44408169EC61E228
3 changed files with 13 additions and 9 deletions

View File

@ -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

View File

@ -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

13
Jenkinsfile vendored
View File

@ -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'