Add code coverage to Jenkins
All checks were successful
timw4mail/json-parser/pipeline/head This commit looks good
All checks were successful
timw4mail/json-parser/pipeline/head This commit looks good
This commit is contained in:
parent
cefaa86ded
commit
6fa2f100b4
12
Jenkinsfile
vendored
12
Jenkinsfile
vendored
@ -2,6 +2,7 @@ pipeline {
|
||||
agent {
|
||||
docker {
|
||||
image 'rust:latest'
|
||||
args '-u root --privileged'
|
||||
}
|
||||
}
|
||||
stages {
|
||||
@ -15,5 +16,16 @@ pipeline {
|
||||
sh "cargo test"
|
||||
}
|
||||
}
|
||||
stage('Coverage') {
|
||||
steps {
|
||||
sh "cargo install cargo-tarpaulin"
|
||||
sh "make generate-coverage"
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
cobertura coberturaReportFile: 'cobertura.xml'
|
||||
}
|
||||
}
|
||||
}
|
14
Makefile
Normal file
14
Makefile
Normal file
@ -0,0 +1,14 @@
|
||||
coverage: coverage.html
|
||||
|
||||
coverage.html: coverage-report
|
||||
|
||||
generate-coverage:
|
||||
cargo tarpaulin --out Xml
|
||||
|
||||
coverage-report: generate-coverage
|
||||
pycobertura show --format html --output coverage.html cobertura.xml
|
||||
|
||||
clean:
|
||||
cargo clean
|
||||
rm cobertura.xml
|
||||
rm coverage.html
|
Loading…
Reference in New Issue
Block a user