Enable codecov

Signed-off-by: Nic Cope <negz@rk0n.org>
This commit is contained in:
Nic Cope 2020-02-19 16:50:08 -08:00
parent 5471f6521c
commit fceadf2d13
1 changed files with 5 additions and 24 deletions

29
Jenkinsfile vendored
View File

@ -17,6 +17,7 @@ pipeline {
DOCKER = credentials('dockerhub-upboundci') DOCKER = credentials('dockerhub-upboundci')
AWS = credentials('aws-upbound-bot') AWS = credentials('aws-upbound-bot')
GITHUB_UPBOUND_BOT = credentials('github-upbound-jenkins') GITHUB_UPBOUND_BOT = credentials('github-upbound-jenkins')
CODECOV_TOKEN = credentials('codecov-crossplane-runtime')
} }
stages { stages {
@ -95,37 +96,17 @@ pipeline {
} }
} }
stage('Record Coverage') { stage('Publish Coverage to Codecov') {
when { when {
allOf { expression {
branch 'master'; return env.shouldBuild != "false"
expression {
return env.shouldBuild != "false"
}
} }
} }
steps { steps {
script { script {
currentBuild.result = 'SUCCESS' sh 'curl -s https://codecov.io/bash | bash -s -- -c -f _output/tests/**/coverage.txt -F unittests'
}
step([$class: 'MasterCoverageAction', scmVars: [GIT_URL: env.GIT_URL]])
}
}
stage('PR Coverage to Github') {
when {
allOf {
not { branch 'master' };
expression { return env.CHANGE_ID != null };
expression { return env.shouldBuild != "false"}
} }
} }
steps {
script {
currentBuild.result = 'SUCCESS'
}
step([$class: 'CompareCoverageAction', publishResultAs: 'comment', scmVars: [GIT_URL: env.GIT_URL]])
}
} }
} }