You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
766 B

#!/usr/bin/env groovy
node {
def root = tool name: 'System Go', type: 'go'
ws("${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}/src/") {
withEnv(["GOROOT=${root}", "GOPATH=${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}/", "PATH+GO=${root}/bin"]) {
stage 'Checkout'
checkout scm
stage 'preTest'
sh 'go version'
sh 'go get'
sh 'go get -u'
sh 'dep init'
stage 'Test'
sh 'go vet'
sh 'go test -v ./... | go-junit-report > report.xml'
sh 'go test -cover'