-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
52 lines (44 loc) · 1.31 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
# Go
# Build your Go project.
# Add steps that test, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/go
pool:
vmImage: 'Ubuntu-16.04'
variables:
GOBIN: '$(GOPATH)/bin' # Go binaries path
GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path
GO111MODULE: 'on'
modulePath: '$(GOPATH)/src/go.bobheadxi.dev/res'
steps:
- task: GoTool@0
inputs:
version: '1.12'
- 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)'
displayName: 'Set up the Go workspace'
- script: |
go version
go get -v -t -d ./...
go get -u golang.org/x/lint/golint
workingDirectory: '$(modulePath)'
displayName: 'Get dependencies'
- script: |
go vet ./...
go fmt ./...
golint $(go list ./... | grep -v /vendor/)
workingDirectory: '$(modulePath)'
displayName: 'Run static analysis'
- script: |
go test -race -coverprofile=coverage.txt ./...
workingDirectory: '$(modulePath)'
displayName: 'Run tests and report coverage'
- script: bash <(curl -s https://codecov.io/bash) -t $(CODECOV_TOKEN)
workingDirectory: '$(modulePath)'
displayName: 'Report coverage'
condition: succeeded()