From 5e4e80f6b2ebe635206dfef92414ca7e65777f9f Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Wed, 16 Oct 2019 12:40:18 -0700 Subject: [PATCH] Add Go 1.13 to CI Updated Linux image to 18.04 Removed travis file. --- azure-pipelines.yml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9dc7b82e01ab..fad812664b8c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,22 +1,22 @@ jobs: - - job: Build_Test + - job: BuildAndTest 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)' 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: @@ -31,25 +31,24 @@ jobs: displayName: 'Create Go Workspace' - script: | set -e - go version 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 @@ -57,14 +56,14 @@ jobs: displayName: 'Copyright Header Check' failOnStderr: true condition: succeededOrFailed() - - script: gofmt -s -l -w $(find . -path ./vendor -prune -o -name '*.go' -print) >&2 + - script: $(GOROOT)/bin/gofmt -s -l -w $(find . -path ./vendor -prune -o -name '*.go' -print) >&2 workingDirectory: '$(sdkPath)' displayName: 'Format Check' failOnStderr: true condition: succeededOrFailed() - script: | - golint ./storage/... >&2 - golint ./tools/... >&2 + $(GOROOT)/bin/golint ./storage/... >&2 + $(GOROOT)/bin/golint ./tools/... >&2 workingDirectory: '$(sdkPath)' displayName: 'Linter Check' failOnStderr: true