From 9ed875b6f283843b0b0d78ebbaa7f295ae765c75 Mon Sep 17 00:00:00 2001 From: Mrinal Wadhwa Date: Fri, 9 Nov 2018 14:20:42 -0800 Subject: [PATCH] build: add azure build pipeline --- azure-pipelines.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 azure-pipelines.yml 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'