From c4cd384f73909e6d478eda0d77ca52c576640f0a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 11 Jul 2023 23:00:12 +0200 Subject: [PATCH] add jenkins CI files --- automation/Dockerfile | 15 ++++++++++++ automation/Jenkinsfile | 52 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 automation/Dockerfile create mode 100644 automation/Jenkinsfile diff --git a/automation/Dockerfile b/automation/Dockerfile new file mode 100644 index 0000000..09132c5 --- /dev/null +++ b/automation/Dockerfile @@ -0,0 +1,15 @@ +# Run the following commands from root directory to build and run locally +# docker build -f automation/Dockerfile -t . +# docker run -it +FROM rust:latest +RUN apt-get update +RUN apt-get --yes upgrade +# tzdata is a dependency, won't install otherwise +ARG DEBIAN_FRONTEND=noninteractive + +# set CROSS_CONTAINER_IN_CONTAINER to inform `cross` that it is executed from within a container +ENV CROSS_CONTAINER_IN_CONTAINER=true + +RUN rustup install nightly && \ + rustup target add thumbv7em-none-eabihf armv7-unknown-linux-gnueabihf && \ + rustup component add rustfmt clippy diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile new file mode 100644 index 0000000..41c4d46 --- /dev/null +++ b/automation/Jenkinsfile @@ -0,0 +1,52 @@ +pipeline { + + agent { + dockerfile { + dir 'automation' + reuseNode true + } + } + + stages { + stage('Clippy') { + steps { + sh 'cargo clippy' + } + } + stage('Docs') { + steps { + sh 'cargo +nightly doc --all-features' + } + } + stage('Rustfmt') { + steps { + sh 'cargo fmt --all --check' + } + } + stage('Test') { + steps { + sh 'cargo test --all-features' + } + } + stage('Check with all features') { + steps { + sh 'cargo check --all-features' + } + } + stage('Check with no features') { + steps { + sh 'cargo check --no-default-features' + } + } + stage('Check Cross Embedded Bare Metal') { + steps { + sh 'cargo check --target thumbv7em-none-eabihf --no-default-features' + } + } + stage('Check Cross Embedded Linux') { + steps { + sh 'cargo check --target armv7-unknown-linux-gnueabihf' + } + } + } +}