-
Notifications
You must be signed in to change notification settings - Fork 14
/
azure-pipelines.yml
52 lines (42 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
trigger:
- master
- dev
pool:
vmImage: 'ubuntu-latest'
variables:
GOVERSION: 1.13
GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path
GOBIN: '$(GOPATH)/bin' # Go binaries path
steps:
- script: |
docker run -d -p 3306:3306 --name mysql8 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes mysql:8
displayName: 'Start Mysql docker'
- script: |
docker run -d -p 3305:3306 --name mariadb101 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes mariadb:10.1
displayName: 'Start old MariaDB docker'
- task: GoTool@0
displayName: 'Use Go $(GOVERSION)'
inputs:
version: '$(GOVERSION)'
- task: Go@0
inputs:
command: 'get'
arguments: 'github.com/axw/gocov/...'
- task: Go@0
inputs:
command: 'get'
arguments: 'github.com/AlekSi/gocov-xml'
- script: |
$GOBIN/gocov test -v | $GOBIN/gocov-xml > coverage.xml
workingDirectory: $(System.DefaultWorkingDirectory)
displayName: "Execute Tests and Generate Coverage Report"
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml'
failIfCoverageEmpty: true
displayName: "Publish Coverage Results"