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' + } + } + } +}