Skip to content

Commit

Permalink
enable build and test on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendrixMSFT committed Jul 9, 2019
1 parent c35c12c commit 1a7af2d
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,39 @@ pool:

trigger:
- master

variables:
GOROOT: '/usr/local/go1.12'
GOPATH: '$(system.defaultWorkingDirectory)/work'
sdkPath: '$(GOPATH)/src/github.com/$(build.repository.name)'

steps:
- script: |
mkdir -p '$(GOPATH)'
mkdir -p '$(sdkPath)'
shopt -s extglob
mv !(GOPATH) '$(sdkPath)'
echo '##vso[task.prependpath]$(GOROOT)/bin'
echo '##vso[task.prependpath]$(GOPATH)/bin'
displayName: 'Create Go Workspace'
- script: |
curl -sSL https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure -v
go install ./vendor/golang.org/x/lint/golint
workingDirectory: '$(sdkPath)'
displayName: 'Install Dependencies'
- script: |
grep -L -r --include *.go --exclude-dir vendor -P "Copyright (\d{4}|\(c\)) Microsoft" ./ | tee /dev/stderr | test -z "$(< /dev/stdin)"
test -z "$(gofmt -s -l -w ./autorest/. | tee /dev/stderr)"
test -z "$(golint ./autorest/... | tee /dev/stderr)"
workingDirectory: '$(sdkPath)'
displayName: 'Formatting and Linting'
- script: |
go vet ./autorest/...
go build -v ./autorest/...
workingDirectory: '$(sdkPath)'
displayName: 'Vet and Build'
- script: |
go test -race -v ./autorest/...
workingDirectory: '$(sdkPath)'
displayName: 'Run Tests'

0 comments on commit 1a7af2d

Please sign in to comment.