From 14835c38d9cace59afb2e678d031981670d7a54b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 12 Dec 2021 23:17:30 +0100 Subject: [PATCH] added CI/CD files --- automation/Dockerfile | 11 +++++++++ automation/Jenkinsfile | 52 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 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..84da5d0 --- /dev/null +++ b/automation/Dockerfile @@ -0,0 +1,11 @@ +# 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 + +RUN rustup target add thumbv6m-none-eabi armv7-unknown-linux-gnueabihf && \ + rustup component add rustfmt clippy diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile new file mode 100644 index 0000000..e8ae0e3 --- /dev/null +++ b/automation/Jenkinsfile @@ -0,0 +1,52 @@ +pipeline { + agent any + + stages { + stage('Clippy') { + agent { + dockerfile { + dir 'automation' + reuseNode true + } + } + steps { + sh 'cargo clippy' + } + } + stage('Rustfmt') { + agent { + dockerfile { + dir 'automation' + reuseNode true + } + } + steps { + sh 'cargo fmt' + } + } + stage('Check') { + agent { + dockerfile { + dir 'automation' + reuseNode true + } + } + steps { + sh 'cargo check --target thumbv6m-none-eabi' + sh 'cargo check --target armv7-unknown-linux-gnueabihf' + } + } + stage('Check Examples') { + agent { + dockerfile { + dir 'automation' + reuseNode true + } + } + steps { + sh 'cargo check --target thumbv6m-none-eabi --examples' + sh 'cargo check --target armv7-unknown-linux-gnueabihf' + } + } + } +} \ No newline at end of file