File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ # Build your Go project.
2+ # Add steps that test, save build artifacts, deploy, and more:
3+ # https://docs.microsoft.com/azure/devops/pipelines/languages/go
4+
5+ trigger :
6+ - master
7+
8+ pool :
9+ vmImage : ' ubuntu-latest'
10+
11+ variables :
12+ GOBIN : ' $(GOPATH)/bin' # Go binaries path
13+ GOROOT : ' /usr/local/go1.11' # Go installation path
14+ GOPATH : ' $(system.defaultWorkingDirectory)/gopath' # Go workspace path
15+ modulePath : ' $(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code
16+
17+ steps :
18+ - script : |
19+ mkdir -p '$(GOBIN)'
20+ mkdir -p '$(GOPATH)/pkg'
21+ mkdir -p '$(modulePath)'
22+ shopt -s extglob
23+ shopt -s dotglob
24+ mv !(gopath) '$(modulePath)'
25+ echo '##vso[task.prependpath]$(GOBIN)'
26+ echo '##vso[task.prependpath]$(GOROOT)/bin'
27+ displayName : ' Set up the Go workspace'
28+
29+ - script : |
30+ go version
31+ go get -v -t -d ./...
32+ if [ -f Gopkg.toml ]; then
33+ curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
34+ dep ensure
35+ fi
36+ go test ./...
37+ go build -v .
38+ workingDirectory : ' $(modulePath)'
39+ displayName : ' Get dependencies, then build'
You can’t perform that action at this time.
0 commit comments