From ab11f56351f8db6cf26f84011c55543c45276bde Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Wed, 16 Oct 2019 14:00:17 -0700 Subject: [PATCH] Add Go 1.13 to CI (#6061) Updated Ubuntu image to 18.04. Removed travis CI file. --- .travis.yml | 40 -------------- azure-pipelines.yml | 125 ++++++++++++++++++++++++-------------------- 2 files changed, 69 insertions(+), 96 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e2ec152676c1..000000000000 --- a/.travis.yml +++ /dev/null @@ -1,40 +0,0 @@ -sudo: false - -language: go -go: - - 1.10.x - - 1.11.x - - 1.12.x - -branches: - only: - - master - - latest - -env: - global: - - DEP_RELEASE_TAG=v0.5.1 # so the script knows which version to use - - IGNORE_BREAKING_CHANGES=true - -before_install: - - curl -sSL https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - -install: - - dep ensure -v - -script: - - bash rungas.sh - - grep -L -r --include *.go --exclude-dir vendor -P "Copyright (\d{4}|\(c\)) Microsoft" ./ | tee /dev/stderr | test -z "$(< /dev/stdin)" - - echo -e "travis_fold:start:go.build\033[33;1mBuilding all packages\033[0m" - - go build -v $(go list ./... | grep -v vendor) - - echo -e "\ntravis_fold:end:go.build\r" - - if [[ $TRAVIS_GO_VERSION == 1.11* ]]; then test -z "$(go fmt $(go list ./... | grep -v vendor) | tee /dev/stderr)"; fi - - go vet $(go list ./... | grep -v vendor) - - go test $(sh ./findTestedPackages.sh) - - go run ./tools/apidiff/main.go packages ./services FETCH_HEAD~1 FETCH_HEAD --copyrepo --breakingchanges || $IGNORE_BREAKING_CHANGES - - go run ./tools/pkgchk/main.go ./services --exceptions ./tools/pkgchk/exceptions.txt - - git diff --exit-code - -cache: - directories: - - $GOPATH/pkg/dep diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d254313e0985..9dc7b82e01ab 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,58 +1,71 @@ -pool: - vmImage: 'Ubuntu 16.04' +jobs: + - 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)' -variables: - GOROOT: '/usr/local/go1.12' - GOPATH: '$(system.defaultWorkingDirectory)/work' - sdkPath: '$(GOPATH)/src/github.com/$(build.repository.name)' - IGNORE_BREAKING_CHANGES: true + pool: + vmImage: $(vm.image) -steps: -- script: | - set -e - mkdir -p '$(GOPATH)/bin' - mkdir -p '$(sdkPath)' - shopt -s dotglob extglob - mv !(work) '$(sdkPath)' - echo '##vso[task.prependpath]$(GOROOT)/bin' - echo '##vso[task.prependpath]$(GOPATH)/bin' - 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 - workingDirectory: '$(sdkPath)' - displayName: 'Install Dependencies' -- script: go vet $(go list ./... | grep -v vendor) - workingDirectory: '$(sdkPath)' - displayName: 'Vet' -- 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) - workingDirectory: '$(sdkPath)' - displayName: 'Run Tests' -- 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 - 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: 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 - workingDirectory: '$(sdkPath)' - displayName: 'Linter Check' - failOnStderr: true - condition: succeededOrFailed() + variables: + GOPATH: '$(system.defaultWorkingDirectory)/work' + sdkPath: '$(GOPATH)/src/github.com/$(build.repository.name)' + IGNORE_BREAKING_CHANGES: true + + steps: + - script: | + set -e + mkdir -p '$(GOPATH)/bin' + mkdir -p '$(sdkPath)' + shopt -s dotglob extglob + mv !(work) '$(sdkPath)' + echo '##vso[task.prependpath]$(GOROOT)/bin' + echo '##vso[task.prependpath]$(GOPATH)/bin' + 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 + workingDirectory: '$(sdkPath)' + displayName: 'Install Dependencies' + - script: go vet $(go list ./... | grep -v vendor) + workingDirectory: '$(sdkPath)' + displayName: 'Vet' + - 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) + workingDirectory: '$(sdkPath)' + displayName: 'Run Tests' + - 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 + 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: 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 + workingDirectory: '$(sdkPath)' + displayName: 'Linter Check' + failOnStderr: true + condition: succeededOrFailed()