From f6ec267d0da4a978bc4aef82d091c79929b98145 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Mon, 3 Aug 2020 03:38:29 +0100 Subject: [PATCH] Add Jenkinsfile --- Jenkinsfile | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..e3fe53d --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,50 @@ +pipeline { + agent { + kubernetes { + yaml """ +spec: + securityContext: + runAsUser: 1000 + containers: + - name: rust-build-agent + image: rust:1.45.1-stretch + tty: true + command: + - cat +""" + defaultContainer 'rust-build-agent' + } + } + + stages { + stage('Check') { + parallel { + stage('Rustfmt') { + steps { + sh 'rustup component add rustfmt' + sh 'cargo fmt --all -- --check' + } + } + + stage('Clippy') { + steps { + sh 'rustup component add clippy' + sh 'cargo clippy --all --all-targets --all-features -- -Dwarnings' + } + } + } + } + + stage('Test') { + steps { + sh 'cargo test --all --all-targets --all-features' + } + } + + stage('Build') { + steps { + sh 'cargo build --release --all --all-targets --all-features' + } + } + } +} -- libgit2 1.7.2