Skip to content

Commit 7c660f3

Browse files
committed
Set up CI with Azure Pipelines
[skip ci]
1 parent 0cc9027 commit 7c660f3

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

Diff for: azure-pipelines.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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'

0 commit comments

Comments
 (0)