update jenkinsfile

This commit is contained in:
2026-04-08 06:56:09 +01:00
parent 87c51ba8fc
commit 88c75e43ae
7 changed files with 103 additions and 47 deletions
+49 -12
View File
@@ -1,20 +1,57 @@
pipeline {
agent any
agent any
environment {
CARGO_TERM_COLOR = 'always'
}
stages {
stage('CI') {
steps {
withChecks(name: 'Rust CI', includeStage: true) {
stage('Build') {
steps {
withChecks(name: 'Test', includeStage: true) {
sh '''
set -e
which rustc
which cargo
rustc --version
cargo --version
make ci
set -eux
make ci
'''
}
}
publishHTML(target: [
allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'target/llvm-cov/html',
reportFiles: 'index.html',
reportName: 'Rust Coverage HTML',
reportTitles: 'Coverage Report'
])
}
} // Test
stage('Coverage') {
steps {
sh '''
set -eux
make cobertura
'''
recordCoverage(
tools: [[parser: 'COBERTURA', pattern: 'target/llvm-cov/cobertura.xml']],
sourceCodeRetention: 'LAST_BUILD',
enabledForFailure: true,
failOnError: true,
checksAnnotationScope: 'MODIFIED_LINES',
checksName: 'Rust Coverage',
qualityGates: [
[metric: 'LINE', baseline: 'MODIFIED_LINES', threshold: 20.0],
[metric: 'LINE', baseline: 'PROJECT', threshold: 20.0],
[metric: 'BRANCH', baseline: 'PROJECT', threshold: 20.0]
]
)
}
}
} // Cobertura
}
}
post {
always {
archiveArtifacts artifacts: 'target/llvm-cov/**', fingerprint: true
}
}
}