Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

track2 CI fixes #6760

Merged
merged 1 commit into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
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
17 changes: 14 additions & 3 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
trigger:
paths:
exclude:
- sdk/

pr:
paths:
exclude:
- sdk/

jobs:
- job: Build_Test
strategy:
Expand All @@ -18,6 +28,7 @@ jobs:
GOPATH: '$(system.defaultWorkingDirectory)/work'
sdkPath: '$(GOPATH)/src/github.com/$(build.repository.name)'
IGNORE_BREAKING_CHANGES: true
go.list.filter: 'grep -v vendor | grep -v azure-sdk-for-go/sdk'

steps:
- script: |
Expand All @@ -37,13 +48,13 @@ jobs:
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 ./... $(go.list.filter))
workingDirectory: '$(sdkPath)'
displayName: 'Vet'
- script: go build -v $(go list ./... | grep -v vendor)
- script: go build -v $(go list ./... $(go.list.filter))
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 -path ./sdk -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
Expand Down
67 changes: 67 additions & 0 deletions sdk/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
trigger:
paths:
include:
- sdk/

pr:
paths:
include:
- sdk/

jobs:
- job: Build_Test
strategy:
matrix:
Linux_Go113:
vm.image: 'ubuntu-18.04'
go.version: '1.13'
GOROOT: '/usr/local/go$(go.version)'

pool:
vmImage: $(vm.image)

variables:
GOPATH: '$(system.defaultWorkingDirectory)/work'
sdkPath: '$(GOPATH)/src/github.com/$(build.repository.name)'

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
go get -u golang.org/x/lint/golint
workingDirectory: '$(sdkPath)'
displayName: 'Install Dependencies'
- script: go vet $(go list ./sdk/...)
workingDirectory: '$(sdkPath)'
displayName: 'Vet'
- script: go build -v $(go list ./sdk/...)
workingDirectory: '$(sdkPath)'
displayName: 'Build'
- script: go test ./sdk/...
workingDirectory: '$(sdkPath)'
displayName: 'Run Tests'
- script: grep -L -r --include \*.go -P "Copyright (\d{4}|\(c\)) Microsoft" ./sdk | tee >&2
workingDirectory: '$(sdkPath)'
displayName: 'Copyright Header Check'
failOnStderr: true
condition: succeededOrFailed()
- script: gofmt -s -l -w $(find ./sdk -name '*.go' -print) >&2
workingDirectory: '$(sdkPath)'
displayName: 'Format Check'
failOnStderr: true
condition: succeededOrFailed()
- script: |
golint ./sdk/... >&2
workingDirectory: '$(sdkPath)'
displayName: 'Linter Check'
failOnStderr: true
condition: succeededOrFailed()