diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fad812664b8c..5ce8e1746eea 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,22 +1,30 @@ jobs: - - job: BuildAndTest + - job: Build_Test strategy: matrix: Linux_Go112: vm.image: 'ubuntu-18.04' go.version: '1.12' + GOROOT: '/usr/local/go$(go.version)' Linux_Go113: vm.image: 'ubuntu-18.04' go.version: '1.13' + GOROOT: '/usr/local/go$(go.version)' + Win_Go112: + vm.image: 'windows-2019' + go.version: '1.12' + GOROOT: 'c:\go$(go.version)' + Win_Go113: + vm.image: 'windows-2019' + go.version: '1.13' + GOROOT: 'c:\go$(go.version)' pool: vmImage: $(vm.image) variables: - GOROOT: '/usr/local/go$(go.version)' GOPATH: '$(system.defaultWorkingDirectory)/work' sdkPath: '$(GOPATH)/src/github.com/$(build.repository.name)' - GO: '$(GOROOT)/bin/go' IGNORE_BREAKING_CHANGES: true steps: @@ -28,27 +36,28 @@ jobs: mv !(work) '$(sdkPath)' echo '##vso[task.prependpath]$(GOROOT)/bin' echo '##vso[task.prependpath]$(GOPATH)/bin' + go version displayName: 'Create Go Workspace' - script: | set -e curl -sSL https://raw.githubusercontent.com/golang/dep/master/install.sh | sh dep ensure -v - $(GO) get -u golang.org/x/lint/golint + go get -u golang.org/x/lint/golint workingDirectory: '$(sdkPath)' displayName: 'Install Dependencies' - - script: $(GO) vet $($(GO) list ./... | grep -v vendor) + - script: go vet $(go list ./... | grep -v vendor) workingDirectory: '$(sdkPath)' displayName: 'Vet' - - script: $(GO) build -v $($(GO) list ./... | grep -v vendor) + - script: go build -v $(go list ./... | grep -v vendor) workingDirectory: '$(sdkPath)' displayName: 'Build' - - script: $(GO) test $(dirname $(find . -path ./vendor -prune -o -name '*_test.go' -print) | sort -u) + - script: go test $(dirname $(find . -path ./vendor -prune -o -name '*_test.go' -print) | sort -u) workingDirectory: '$(sdkPath)' displayName: 'Run Tests' - - script: $(GO) run ./tools/apidiff/main.go packages ./services FETCH_HEAD~1 FETCH_HEAD --copyrepo --breakingchanges || $IGNORE_BREAKING_CHANGES + - script: go run ./tools/apidiff/main.go packages ./services FETCH_HEAD~1 FETCH_HEAD --copyrepo --breakingchanges || $IGNORE_BREAKING_CHANGES workingDirectory: '$(sdkPath)' displayName: 'Display Breaking Changes' - - script: $(GO) run ./tools/pkgchk/main.go ./services --exceptions ./tools/pkgchk/exceptions.txt + - script: go run ./tools/pkgchk/main.go ./services --exceptions ./tools/pkgchk/exceptions.txt workingDirectory: '$(sdkPath)' displayName: 'Verify Package Directory' - script: grep -L -r --include *.go --exclude-dir vendor -P "Copyright (\d{4}|\(c\)) Microsoft" ./ | tee >&2 @@ -56,14 +65,14 @@ jobs: displayName: 'Copyright Header Check' failOnStderr: true condition: succeededOrFailed() - - script: $(GOROOT)/bin/gofmt -s -l -w $(find . -path ./vendor -prune -o -name '*.go' -print) >&2 + - script: gofmt -s -l -w $(find . -path ./vendor -prune -o -name '*.go' -print) >&2 workingDirectory: '$(sdkPath)' displayName: 'Format Check' failOnStderr: true condition: succeededOrFailed() - script: | - $(GOROOT)/bin/golint ./storage/... >&2 - $(GOROOT)/bin/golint ./tools/... >&2 + golint ./storage/... >&2 + golint ./tools/... >&2 workingDirectory: '$(sdkPath)' displayName: 'Linter Check' failOnStderr: true