forked from StackExchange/dnscontrol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
70 lines (63 loc) · 1.76 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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)"
- 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; }
- job: "GoFmt"
displayName: "Check Go Formatting"
steps:
- template: build/azure-pipelines/go-env.yaml
- script: |
set -e
go fmt ./...
git status --porcelain
git diff
[ ! -n "$(git status --porcelain)" ] || { echo "Error: Go files not formatted, please run go fmt ./... ."; false; }
- job: "GoGen"
displayName: "Check Go Generate"
steps:
- template: build/azure-pipelines/go-env.yaml
- script: |
set -e
go generate .
git status --porcelain
git diff
[ ! -n "$(git status --porcelain)" ] || { echo "Error: Generated files not up to date, please run go generate . ."; false; }