diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..237cf81f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,50 @@ +FROM ubuntu:16.04 + +WORKDIR /app + +# common packages +RUN apt-get update && \ + apt-get install -y \ + ca-certificates curl file tar clang libclang-dev \ + build-essential cmake libssl-dev zlib1g-dev \ + ruby-dev libboost-dev git wget && \ + rm -rf /var/lib/apt/lists/* + +# install cucumber package +RUN gem install cucumber -v 2.0.0 --no-rdoc --no-ri + +# install rust toolchain +env RUSTUP_HOME=/usr/local/rustup \ + CARGO_HOME=/usr/local/cargo + +RUN curl https://sh.rustup.rs -sSf | \ + sh -s -- --default-toolchain 1.20.0 -y + +env PATH=/usr/local/cargo/bin:${PATH} + +# install arduino toolchain +RUN wget -nv http://arduino.cc/download.php?f=/arduino-1.8.5-linux64.tar.xz -O arduino-1.8.5.tar.xz + +RUN tar -xf arduino-1.8.5.tar.xz && \ + cd arduino-1.8.5 && \ + mkdir -p /usr/share/arduino && \ + cp -R * /usr/share/arduino + + +# Fetch and build cargo deps +RUN mkdir src && echo "fn main() { }" >> build.rs && touch src/tests.rs + +COPY ./firmware/brake/kia_soul_ev_niro/tests/property/Cargo.toml . +RUN cargo build + +COPY ./firmware/brake/kia_soul_petrol/tests/property/Cargo.toml . +RUN cargo build + +COPY ./firmware/common/libs/pid/tests/property/Cargo.toml . +RUN cargo build + +COPY ./firmware/steering/tests/property/Cargo.toml . +RUN cargo build + +COPY ./firmware/throttle/tests/property/Cargo.toml . +RUN cargo build diff --git a/Jenkinsfile b/Jenkinsfile index 5b6866dc..221c543d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,60 +1,70 @@ #!groovy -def cleanCheckout() { - checkout([ - $class: 'GitSCM', - branches: scm.branches, - extensions: scm.extensions + [[$class: 'CleanBeforeCheckout']], - userRemoteConfigs: scm.userRemoteConfigs - ]) -} +node { + checkout scm + + def image = docker.build("cmake-build:${env.BUILD_ID}") + + def builds = [:] + def output = image.inside { + sh returnStdout: true, script: "cmake -LA ./firmware | grep 'VEHICLE_VALUES' | cut -d'=' -f 2" + } + + def platforms = output.trim().tokenize(';') + + for(int j=0; j 0 ) { - if ( obd_frame_callback != NULL && - ( rx_frame.can_id == KIA_SOUL_OBD_WHEEL_SPEED_CAN_ID || - rx_frame.can_id == KIA_SOUL_OBD_BRAKE_PRESSURE_CAN_ID || - rx_frame.can_id == KIA_SOUL_OBD_STEERING_WHEEL_ANGLE_CAN_ID ) ) + if ( obd_frame_callback != NULL ) { obd_frame_callback( &rx_frame ); } diff --git a/firmware/throttle/src/throttle_control.cpp b/firmware/throttle/src/throttle_control.cpp index 3745a0e8..4c15b5b3 100644 --- a/firmware/throttle/src/throttle_control.cpp +++ b/firmware/throttle/src/throttle_control.cpp @@ -61,8 +61,7 @@ void check_for_faults( void ) DEBUG_PRINTLN( "Bad value read from accelerator position sensor" ); } - else if ( operator_overridden == true - && g_throttle_control_state.operator_override == false ) + else if ( operator_overridden == true ) { disable_control( );