spacepackets/automation/Jenkinsfile

80 lines
1.9 KiB
Plaintext
Raw Normal View History

2022-08-05 00:44:41 +02:00
pipeline {
2022-08-16 10:23:39 +02:00
2023-12-01 16:00:29 +01:00
agent {
dockerfile {
dir 'automation'
reuseNode true
args '--network host'
2022-08-16 10:23:39 +02:00
}
2023-12-01 16:00:29 +01:00
}
2022-08-05 00:44:41 +02:00
2023-12-01 16:00:29 +01:00
stages {
stage('Rust Toolchain Info') {
steps {
sh 'rustc --version'
}
}
stage('Clippy') {
steps {
sh 'cargo clippy'
}
}
stage('Docs') {
steps {
sh 'cargo +nightly doc --all-features'
2023-01-10 23:22:09 +01:00
}
2023-12-01 16:00:29 +01:00
}
stage('Rustfmt') {
steps {
sh 'cargo fmt --all --check'
2022-08-05 00:44:41 +02:00
}
2023-12-01 16:00:29 +01:00
}
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'
}
}
stage('Run test with Coverage') {
when {
anyOf {
branch 'main';
branch pattern: 'cov-deployment*'
2022-08-16 10:28:06 +02:00
}
2023-12-01 16:00:29 +01:00
}
steps {
script {
withEnv(['RUSTFLAGS=-Cinstrument-coverage', 'LLVM_PROFILE_FILE=target/coverage/%p-%m.profraw']) {
echo "Executing tests with coverage"
sh 'cargo test'
sh 'grcov . -s . --binary-path ./target/debug -t html --branch --ignore-not-existing -o ./target/debug/coverage/'
sshagent(credentials: ['documentation-buildfix']) {
// Deploy to Apache webserver
2023-12-01 16:20:38 +01:00
sh 'rsync -r --delete ./target/debug/coverage/ buildfix@documentation.irs.uni-stuttgart.de:/projects/spacepackets-rs/coverage/latest'
2022-08-16 10:50:21 +02:00
}
2023-12-01 16:00:29 +01:00
}
2022-08-16 10:50:21 +02:00
}
2023-12-01 16:00:29 +01:00
}
2022-08-05 00:44:41 +02:00
}
2023-12-01 16:00:29 +01:00
}
2022-08-05 00:44:41 +02:00
}