-
Notifications
You must be signed in to change notification settings - Fork 9
/
poa-azure-pipeline.yml
140 lines (125 loc) · 4.67 KB
/
poa-azure-pipeline.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
strategy:
matrix:
Windows-VS2019:
imageName: 'windows-2019'
netcore_sdk: 3.1.201
rustup_toolchain: stable
Osx-Mojave:
imageName: 'macos-10.14'
netcore_sdk: 3.1.201
rustup_toolchain: stable
Ubuntu-1604:
imageName: 'ubuntu-16.04'
netcore_sdk: 3.1.201
rustup_toolchain: stable
maxParallel: 3
variables:
release.type: '-beta'
BuildPlatform: 'any cpu'
BuildConfiguration: 'Debug'
pool:
vmImage: $(imageName)
trigger:
batch: true
branches:
include:
- develop
exclude:
- master/*
- release/*
pr:
autoCancel: true
branches:
include:
- develop
- feature/*
exclude:
- master/*
- release/*
schedules:
- cron: "0 0 * * *"
displayName: Daily midnight build
branches:
include:
- master
- develop
- releases/*
- feature/*
always: true
steps:
- task: InstallSSHKey@0
inputs:
knownHostsEntry: 'ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts'
sshPublicKey: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrLDdJA3U1bx1dmLIulqY078VUr3i4ofPxEokCGdchsDirDAKK4nQVnkaenYMbTndcE+/3+RDEAzy4h75Y3CU8J5FoSjOjKzOi/IPl6Ssj9IKtOVBt8YP+qUHsVnEvm+m9ITAJfqQY9ctKH/0CdBxopMfRHR2BHYbMtGjNtTRO5JZ6rEpbFU8jAYLYBZd0HMBnjpKOACPhRl1Ql3eRwrpEwtW9WHc2GzO4G4nbTvtd2jiT07B/kaCyr27p8K1+waftZ/5aPE0Ou5e41d1knbE7djoA2d218nLQe4DK+5LZJNrGHmJIMwLfXV71e0zeCdaLV8/GypbUZDJ+tJQLPTDx nsh@shenron'
sshKeySecureFile: 'id_rsa'
- task: DotNetCoreInstaller@0
displayName: 'Install .NetCore SDK'
inputs:
version: 3.1.201
- bash: |
git submodule update --init --force --recursive
displayName: 'Clone submodules'
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
displayName: Install rust
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
displayName: Windows install rust
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- task: DotNetCoreCLI@2
displayName: 'Build solution'
inputs:
projects: 'src/**/*.csproj'
arguments: '--configuration $(BuildConfiguration)'
failOnStandardError: 'true'
- script: 'dotnet tool install --global dotnet-reportgenerator-globaltool'
displayName: 'Install coverage tools'
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- task: DotNetCoreCLI@2
displayName: 'Run unit tests'
inputs:
command: test
projects: 'src/*[Tt]ests/*.csproj'
arguments: '--filter TestType!=IntegrationTest --configuration $(BuildConfiguration)'
failOnStandardError: 'true'
timeoutInMinutes: 20
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- task: DotNetCoreCLI@2
displayName: 'Run unit tests with coverage'
inputs:
command: test
projects: 'src/*[Tt]ests/*.csproj'
arguments: '--filter TestType!=IntegrationTest --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:UseSourceLink=true /p:Include="\"[Catalyst.Core.Lib*]Catalyst.Core.Lib*\"" /p:Threshold=0 /p:ThresholdType=line /p:ThresholdStat=total'
failOnStandardError: 'true'
timeoutInMinutes: 20
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- task: DotNetCoreCLI@2
displayName: 'Run integration tests'
inputs:
command: test
projects: 'src/*[Tt]ests/*.csproj'
arguments: '--filter TestType=IntegrationTest --configuration $(BuildConfiguration)'
failOnStandardError: 'true'
timeoutInMinutes: 20
- script: |
reportgenerator "-reports:src/**/coverage.cobertura.xml" "-targetdir:$(Build.ArtifactStagingDirectory)" -reporttypes:HtmlInline_AzurePipelines;Cobertura;SonarQube;Badges "-assemblyfilters:+Catalyst.Core.Lib*;+Catalyst.Core.Modules.Kvm*;"
displayName: 'Generate unit test coverage'
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- task: PublishBuildArtifacts@1
displayName: 'Store coverage report'
inputs:
ArtifactName: 'coverage-report'
failOnStandardError: 'true'
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- task: PublishCodeCoverageResults@1
displayName: 'Publish coverage report'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.ArtifactStagingDirectory)/Cobertura.xml'
reportDirectory: '$(Build.ArtifactStagingDirectory)'
failOnStandardError: 'true'
condition: eq( variables['Agent.OS'], 'Windows_NT' )