mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 13:29:11 +01:00
51 lines
1.5 KiB
YAML
51 lines
1.5 KiB
YAML
pool:
|
|
vmImage: 'Ubuntu 16.04'
|
|
|
|
variables:
|
|
GOROOT: '/usr/local/go1.12'
|
|
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 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
|
|
go get -u github.com/stretchr/testify
|
|
workingDirectory: '$(sdkPath)'
|
|
displayName: 'Install Dependencies'
|
|
- script: go vet ./autorest/...
|
|
workingDirectory: '$(sdkPath)'
|
|
displayName: 'Vet'
|
|
- script: go build -v ./autorest/...
|
|
workingDirectory: '$(sdkPath)'
|
|
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()
|