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/git.wegmueller.it/toasterson/uxfiletool") {
withEnv(["GOROOT=${root}", "GOPATH=${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}/", "PATH+GO=${root}/bin"]) {
env.PATH="${GOPATH}/bin:$PATH"
stage 'Checkout'
checkout scm
stage 'preTest'
sh 'go version'
sh 'go get github.com/jstemmer/go-junit-report'
sh 'go get -u github.com/golang/dep/...'
sh 'dep init'
stage 'Test'
sh 'go vet'
sh 'go test -v ./... | go-junit-report > report.xml'
sh 'go test -cover'
}
}
}