-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
84 lines (73 loc) · 2.03 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# https://docs.microsoft.com/azure/devops/pipelines/languages/go
trigger:
batch: true
paths:
exclude:
- README.md
- LICENCE.txt
- modd.conf
- .gitignore
strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
mac:
imageName: 'macOS-latest'
pool:
vmImage: $(imageName)
variables:
GO111MODULE: on
steps:
- task: GoTool@0
inputs:
version: '1.13.5'
- task: Go@0
inputs:
command: 'get'
arguments: '-d'
workingDirectory: '$(System.DefaultWorkingDirectory)'
- task: Go@0
inputs:
command: 'test'
arguments: '-v ./...'
workingDirectory: '$(System.DefaultWorkingDirectory)'
# - 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'
# displayName: 'Set up Go Environment'
# - script: |
# go get -v -t -d ./...
# workingDirectory: '$(modulePath)'
# displayName: 'Fetch Dependencies'
# - script: |
# curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b '$(GOBIN)' v1.21.0
# golangci-lint run -c .golangci.toml
# workingDirectory: '$(modulePath)'
# displayName: 'Lint Code'
# - script: |
# go version
# go test -coverprofile=coverage.out ./...
# workingDirectory: '$(modulePath)'
# displayName: 'Run Tests'
# - script: |
# if [[ "$CODECOV_TOKEN" == "" ]]; then
# echo "CODECOV_TOKEN not set; skipping upload"
# else
# bash <(curl -s https://codecov.io/bash); true
# fi
# if [[ "$CODACY_TOKEN" == "" ]]; then
# echo "CODACY_TOKEN not set; skipping upload"
# else
# go run github.com/schrej/godacov -r coverage.out -t $CODACY_TOKEN -c $BUILD_SOURCEVERSION; true
# fi
# workingDirectory: '$(modulePath)'
# displayName: 'Upload Coverage'
# env:
# CODACY_TOKEN: '$(Codacy.Token)'
# CODECOV_TOKEN: '$(Codecov.Token)'