dnscontrol/azure-pipelines.yml
2020-01-02 16:09:19 -05:00

50 lines
1 KiB
YAML

variables:
GOBIN: '$(GOPATH)/bin' # Go binaries path
GOROOT: '/usr/local/go1.13' # Go installation path
GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path
modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code
trigger:
batch: "true"
branches:
include:
- master
jobs:
- job: Compile
strategy:
maxParallel: 3
matrix:
Windows:
OS: windows
OSX:
OS: darwin
Linux:
OS: linux
steps:
- template: build/azure-pipelines/go-env.yaml
- script: "go run build/build.go -os $(OS)"
workingDirectory: '$(modulePath)'
- job: "unittests"
displayName: "Run Unit Tests"
steps:
- template: build/azure-pipelines/go-env.yaml
- script: "go test ./..."
workingDirectory: '$(modulePath)'
- job: "GoFmt"
steps:
- script: |
go fmt ./...
git diff
git diff --exit-code
- job: "GoGen"
displayName: "Check Go Generate"
steps:
- script: |
go generate .
git diff
git diff --exit-code