spacepackets/automation/Jenkinsfile

82 lines
2.0 KiB
Plaintext
Raw Permalink 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 {
2024-06-25 16:07:07 +02:00
sh """
RUSTDOCFLAGS="--cfg docsrs --generate-link-to-definition -Z unstable-options" 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 {
2024-04-04 13:13:43 +02:00
sh 'cargo nextest r --all-features'
sh 'cargo test --doc'
2023-12-01 16:00:29 +01:00
}
}
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 {
2023-12-06 20:01:36 +01:00
withEnv(['RUSTFLAGS=-Cinstrument-coverage', 'LLVM_PROFILE_FILE=target/coverage/%p-%m.profraw']) {
echo "Executing tests with coverage"
2023-12-07 11:09:06 +01:00
sh 'cargo clean'
2023-12-06 20:01:36 +01:00
sh 'cargo test --all-features'
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-12 11:48:00 +01:00
sh 'rsync --mkpath -r --delete ./target/debug/coverage/ buildfix@documentation.irs.uni-stuttgart.de:/projects/spacepackets/coverage-rs/latest/'
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
}