diff --git a/Jenkinsfile b/Jenkinsfile index 8512cf4..fda5c4a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,8 +25,20 @@ pipeline { stage('Test') { steps { - sh "go test ./... -v" + sh "go test -coverprofile=cover.out ./... -v" + } + } + + stage('Test Coverage') { + steps { + sh "go get github.com/t-yuki/gocover-cobertura" + sh "gocover-cobertura < cover.out > coverage.xml" } } } + post { + always { + cobertura coberturaReportFile: 'coverage.xml' + } + } } \ No newline at end of file