Last active
August 23, 2017 19:38
-
-
Save ntakouris/e3da879b414e5e7c8f34f663c31d65e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stage('Test'){ | |
//List all our project files with 'go list ./... | grep -v /vendor/ | grep -v github.com | grep -v golang.org' | |
//Push our project files relative to ./src | |
sh 'cd $GOPATH && go list ./... | grep -v /vendor/ | grep -v github.com | grep -v golang.org > projectPaths' | |
//Print them with 'awk '$0="./src/"$0' projectPaths' in order to get full relative path to $GOPATH | |
def paths = sh returnStdout: true, script: """awk '\$0="./src/"\$0' projectPaths""" | |
echo 'Vetting' | |
sh """cd $GOPATH && go tool vet ${paths}""" | |
echo 'Linting' | |
sh """cd $GOPATH && golint ${paths}""" | |
echo 'Testing' | |
sh """cd $GOPATH && go test -race -cover ${paths}""" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment