Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ jobs:
- job: Build_Test
strategy:
matrix:
Linux_Go113:
Linux_Go116:
pool.name: azsdk-pool-mms-ubuntu-1804-general
go.version: '1.14'
Linux_Go114:
go.version: '1.16.7'
Linux_Go117:
pool.name: azsdk-pool-mms-ubuntu-1804-general
go.version: '1.15'
go.version: '1.17'

pool:
name: $(pool.name)

variables:
GOPATH: '$(system.defaultWorkingDirectory)/work'
sdkPath: '$(GOPATH)/src/github.com/$(build.repository.name)'
GO111MODULE: 'off'
IGNORE_BREAKING_CHANGES: true
go.list.filter: '| grep -v vendor | grep -v azure-sdk-for-go/sdk | grep -v azure-sdk-for-go/tools'
go.test.filter: '-path ./vendor -prune -o -path ./sdk -prune -o -path ./tools -prune'
Expand All @@ -38,6 +39,7 @@ jobs:
inputs:
version: '$(go.version)'
displayName: "Select Go Version"

- script: |
set -e
mkdir -p '$(GOPATH)/bin'
Expand All @@ -47,6 +49,7 @@ jobs:
echo '##vso[task.prependpath]$(GOROOT)/bin'
echo '##vso[task.prependpath]$(GOPATH)/bin'
displayName: 'Create Go Workspace'

- script: |
set -e
go version
Expand All @@ -55,37 +58,46 @@ jobs:
go get -u golang.org/x/lint/golint
workingDirectory: '$(sdkPath)'
displayName: 'Install Dependencies'

- script: go vet -v $(go list ./... $(go.list.filter))
workingDirectory: '$(sdkPath)'
displayName: 'Vet'

- script: go build -v $(go list ./... $(go.list.filter))
workingDirectory: '$(sdkPath)'
displayName: 'Build'

- script: go test $(dirname $(find . $(go.test.filter) -name '*_test.go' -print) | sort -u)
workingDirectory: '$(sdkPath)'
displayName: 'Run Tests'

- template: /eng/common/pipelines/templates/steps/verify-links.yml
parameters:
Directory: '.'
ScriptDirectory: '$(sdkPath)/eng/common/scripts'
WorkingDirectory: '$(sdkPath)'
Urls: $(Get-ChildItem -Path '$(sdkPath)/*.md' -Recurse | Where {$_.FullName -notlike "*/vendor/*" -and $_.FullName -notlike "*/sdk/*"})

- 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 -d $(find . -path ./vendor -prune -o -name '*.go' -print) >&2
workingDirectory: '$(sdkPath)'
displayName: 'Format Check'
failOnStderr: true
condition: succeededOrFailed()
condition: and(succeededOrFailed(), startsWith(variables['go.version'], '1.16'))

- script: |
golint ./storage/... >&2
workingDirectory: '$(sdkPath)'
Expand Down