gilo/Jenkinsfile
Timothy J. Warren 26f3decced
Some checks failed
timw4mail/gilo/pipeline/head There was a failure building this commit
Attempt to generate CI coverage
2021-04-01 17:23:10 -04:00

44 lines
976 B
Groovy

pipeline {
agent any
tools {
go 'go1.16.2'
}
environment {
GO114MODULE = 'on'
CGO_ENABLED = 0
GOPATH = "${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}"
}
stages {
stage('Pre Test') {
steps {
echo 'Installing dependencies'
sh 'go version'
}
}
stage('Build') {
steps {
echo 'Compiling and building'
sh 'go build'
}
}
stage('Test') {
steps {
sh "go test -coverprofile=cover.out ./... -v"
}
}
stage('Test Coverage') {
steps {
sh "go get github.com/t-yuki/gocover-cobertura"
sh "go run gocover-cobertura < cover.out > coverage.xml"
}
}
}
post {
always {
cobertura coberturaReportFile: 'coverage.xml'
}
}
}