Skip to content

Commit

Permalink
build: add azure build pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
mrinalwadhwa committed Nov 9, 2018
1 parent 0bdffe5 commit 9ed875b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit 9ed875b

Please sign in to comment.