diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..17447f5 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,27 @@ +pool: + vmImage: 'Ubuntu 16.04' + +variables: + GOBIN: '$(GOPATH)/bin' # Go binaries path + GOROOT: '/usr/local/go1.11' # Go installation path + GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path + modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code + +steps: +- script: | + mkdir -p '$(GOBIN)' + mkdir -p '$(GOPATH)/pkg' + mkdir -p '$(modulePath)' + shopt -s extglob + mv !(gopath) '$(modulePath)' + echo '##vso[task.prependpath]$(GOBIN)' + echo '##vso[task.prependpath]$(GOROOT)/bin' + displayName: 'Set up the Go workspace' + +- script: go build -v . + workingDirectory: '$(modulePath)' + displayName: 'Build' + +- script: go test -v ./... + workingDirectory: '$(modulePath)' + displayName: 'Run tests'