Skip to content

Commit

Permalink
add windows builds and refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendrixMSFT authored and azuresdkci committed Oct 21, 2019
1 parent 5e4e80f commit fbc8d3c
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -28,42 +36,43 @@ 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
workingDirectory: '$(sdkPath)'
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
Expand Down

0 comments on commit fbc8d3c

Please sign in to comment.