Skip to content

Commit

Permalink
Refactor azure devops pipeline
Browse files Browse the repository at this point in the history
Break monolithic script into separate scripts with useful names.
Moved formatting checks to the end with succeededOrFailed conditions.
  • Loading branch information
jhendrixMSFT committed Jul 10, 2019
1 parent 95dd057 commit 578eb41
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,27 @@ steps:
go install ./vendor/golang.org/x/lint/golint
workingDirectory: '$(sdkPath)'
displayName: 'Install Dependencies'
- script: |
set -e
grep -L -r --include *.go --exclude-dir vendor -P "Copyright (\d{4}|\(c\)) Microsoft" ./ | tee >&2 | test -z "$(<&0)"
test -z "$(gofmt -s -l -w ./autorest/. | tee >&2)"
test -z "$(golint ./autorest/... | tee >&2)"
- script: go vet ./autorest/...
workingDirectory: '$(sdkPath)'
displayName: 'Formatting and Linting'
- script: |
set -e
go vet ./autorest/...
go build -v ./autorest/...
displayName: 'Vet'
- script: go build -v ./autorest/...
workingDirectory: '$(sdkPath)'
displayName: 'Vet and Build'
- script: |
go test -race -v ./autorest/...
displayName: 'Build'
- script: go test -race -v ./autorest/...
workingDirectory: '$(sdkPath)'
displayName: 'Run Tests'
- 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 ./autorest/. >&2
workingDirectory: '$(sdkPath)'
displayName: 'Format Check'
failOnStderr: true
condition: succeededOrFailed()
- script: golint ./autorest/... >&2
workingDirectory: '$(sdkPath)'
displayName: 'Linter Check'
failOnStderr: true
condition: succeededOrFailed()

0 comments on commit 578eb41

Please sign in to comment.