dnscontrol/azure-pipelines.yml

71 lines
1.8 KiB
YAML
Raw Normal View History

2019-06-27 13:40:18 +08:00
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 -mod=readonly build/build.go -os $(OS)"
2019-06-27 13:40:18 +08:00
- job: "unittests"
displayName: "Run Unit Tests"
steps:
- template: build/azure-pipelines/go-env.yaml
- script: "go test -mod=readonly ./..."
- job: "modtidy"
displayName: "Check Go Modules"
steps:
- template: build/azure-pipelines/go-env.yaml
- script: |
set -e
go mod tidy
git status --porcelain
git diff
[ ! -n "$(git status --porcelain go.mod go.sum)" ] || { echo "Error: go.mod/go.sum outdated, please run go mod tidy."; false; }
- job: "modvendor"
displayName: "Check Go Vendor"
steps:
- template: build/azure-pipelines/go-env.yaml
- script: |
set -e
go mod vendor
git status --porcelain
[ ! -n "$(git status --porcelain vendor)" ] || { echo "Error: Vendor does not match go.mod/go.sum, please run go mod vendor."; false; }
2019-06-27 13:40:18 +08:00
- job: "GoFmt"
displayName: "Check Go Formatting"
2019-06-27 13:40:18 +08:00
steps:
- template: build/azure-pipelines/go-env.yaml
2019-06-27 13:40:18 +08:00
- script: |
set -e
2019-06-27 13:40:18 +08:00
go fmt ./...
git status --porcelain
2019-06-27 13:40:18 +08:00
git diff
[ ! -n "$(git status --porcelain)" ] || { echo "Error: Go files not formatted, please run go fmt ./... ."; false; }
2019-06-27 13:40:18 +08:00
2020-01-03 05:09:19 +08:00
- job: "GoGen"
displayName: "Check Go Generate"
steps:
- template: build/azure-pipelines/go-env.yaml
2020-01-03 05:09:19 +08:00
- script: |
set -e
2020-01-03 05:09:19 +08:00
go generate .
git status --porcelain
2020-01-03 05:09:19 +08:00
git diff
[ ! -n "$(git status --porcelain)" ] || { echo "Error: Generated files not up to date, please run go generate . ."; false; }