-
Notifications
You must be signed in to change notification settings - Fork 849
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick Azure devops changes (#5336)
* add azure devops pipeline * Fixes to devops CI (#5239) * Fixes to devops CI Add devops badge to README Fix lint and vet steps * limit linter to subset of repo fix golint errors * more linter fixes * more linter fixes * add remaining tests * include combined output when running git commands * enable dotglob so hidden dirs are moved
- Loading branch information
1 parent
397140c
commit 211c7f8
Showing
11 changed files
with
147 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
pool: | ||
vmImage: 'Ubuntu 16.04' | ||
|
||
variables: | ||
GOROOT: '/usr/local/go1.12' | ||
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 | ||
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.