diff --git a/Jenkinsfile b/Jenkinsfile index f43d783920831b45d840c11ce3cb4ec8319c8007..93d86b1126008ff8e2049124f69550ed29302ece 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -72,8 +72,14 @@ node('master') { ]) } -if (currentBuild.result == "SUCCESS" || currentBuild.result == "UNSTABLE") { - if (helper.isOriginMaster(this)) { +if (helper.isOriginMaster(this)) { + + node('docker') { + dir('ogs') { checkoutWithTags() } + load 'ogs/scripts/jenkins/coverage.groovy' + } + + if (currentBuild.result == "SUCCESS" || currentBuild.result == "UNSTABLE") { build job: 'OGS-6/clang-sanitizer', wait: false if (tag != "") { keepBuild() @@ -85,9 +91,7 @@ if (currentBuild.result == "SUCCESS" || currentBuild.result == "UNSTABLE") { load 'ogs/scripts/jenkins/docset.groovy' } } - } -} else { - if (helper.isOriginMaster(this)) { + } else { helper.notification(title: "${env.JOB_NAME} failed!", script: this, msg: "Build failed", url: "${env.BUILD_URL}/flowGraphTable/") } diff --git a/scripts/cmake/Coverage.cmake b/scripts/cmake/Coverage.cmake index ee1c60c300c6b270fcddb3725bc32e11860cbd14..70e15b298ae806c8485875f4b85791f4ca8376e4 100644 --- a/scripts/cmake/Coverage.cmake +++ b/scripts/cmake/Coverage.cmake @@ -1,4 +1,5 @@ include(CodeCoverage) +APPEND_COVERAGE_COMPILER_FLAGS() set(COVERAGE_EXCLUDES '/gpfs0/*' diff --git a/scripts/jenkins/coverage.groovy b/scripts/jenkins/coverage.groovy index 77da18c9e394312b3fa3e7d569fc1ead78ca8d0a..fee07fea5dfcbdc737d52894cb07096d617c1349 100644 --- a/scripts/jenkins/coverage.groovy +++ b/scripts/jenkins/coverage.groovy @@ -1,20 +1,23 @@ defaultDockerArgs = '-v /home/jenkins/.ccache:/usr/src/.ccache' -defaultCMakeOptions = '-DOGS_LIB_BOOST=System -DOGS_LIB_VTK=System' -node('docker') { - def build = new ogs.build() +def configure = new ogs.configure() +def build = new ogs.build() - stage('Checkout') { dir('ogs') { checkout scm } } +def image = docker.image('ogs6/gcc-base:latest') +image.pull() +image.inside(defaultDockerArgs) { + stage('Configure (Coverage)') { + configure.linux(cmakeOptions: '-DOGS_COVERAGE=ON', script: this) + } - stage('Build') { - def image = docker.image('ogs6/gcc-base:latest') - image.pull() - image.inside(defaultDockerArgs) { - build this, 'build', '-DOGS_COVERAGE=ON', - 'testrunner_coverage_cobertura ctest_coverage_cobertura' - } + stage('Build (Coverage)') { + build.linux( + script: this, + target: 'testrunner_coverage_cobertura ctest_coverage_cobertura' + ) } +} - archiveArtifacts 'build/*.xml' - // TODO: Report is published in a free-style child job +stage('Publish (Coverage)') { + step([$class: 'CoberturaPublisher', coberturaReportFile: 'build/*.xml']) }