-
Notifications
You must be signed in to change notification settings - Fork 46
/
azure-pipelines.yml
67 lines (58 loc) · 1.6 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
# https://docs.microsoft.com/azure/devops/pipelines/languages/go
trigger:
batch: true
paths:
exclude:
- README.md
- LICENCE
- TODO
- icon.*
- env
- bench.py
- modd.conf
- .gitignore
- .travis.yml
- bin/*
pool:
vmImage: 'macOS-latest'
variables:
GOBIN: '$(GOPATH)/bin' # Go binaries path
GOROOT: '/usr/local/opt/go/libexec' # Go installation path
GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path
BUILD_NUMBER: '$(Build.BuildNumber)'
CI_PULL_REQUEST: '$(Build.SourceBranch)'
CI_PKG_NAME: 'github.com/$(Build.Repository.Name)'
modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code
steps:
- script: |
mkdir -p '$(GOBIN)'
mkdir -p '$(GOPATH)/pkg'
mkdir -p '$(modulePath)'
shopt -s extglob
shopt -s dotglob
mv !(gopath) '$(modulePath)'
echo '##vso[task.prependpath]$(GOBIN)'
echo '##vso[task.prependpath]$(GOROOT)/bin'
go version
displayName: 'Set up Go'
- script: |
go get -v -t -d ./...
workingDirectory: '$(modulePath)'
displayName: Fetch Code
- script: |
go get golang.org/x/lint/golint
go get github.com/golangci/golangci-lint/cmd/golangci-lint
workingDirectory: '$(modulePath)'
displayName: Install Linters
- script: |
./run-tests.sh -l
workingDirectory: '$(modulePath)'
displayName: Lint
- script: |
go get github.com/mfridman/tparse
workingDirectory: '$(modulePath)'
displayName: Install Test Dependences
- script: |
./run-tests.sh -ic ./...
workingDirectory: '$(modulePath)'
displayName: Run Tests