-
Notifications
You must be signed in to change notification settings - Fork 9
/
pr-test-suite-azure-pipelines.yml
128 lines (111 loc) · 4.16 KB
/
pr-test-suite-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
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
strategy:
matrix:
Windows-VS2019:
imageName: 'vs2017-win2016'
netcore_sdk: 3.1.201
rustup_toolchain: nightly
Osx-Mojave:
imageName: 'macos-10.14'
netcore_sdk: 3.1.201
rustup_toolchain: nightly
Ubuntu-1804:
imageName: 'ubuntu-18.04'
netcore_sdk: 3.1.201
rustup_toolchain: nightly
maxParallel: 3
variables:
release.type: '-beta'
BuildPlatform: 'any cpu'
BuildConfiguration: 'Debug'
pool:
vmImage: $(imageName)
pr:
- develop
schedules:
- cron: "0 0 * * *"
displayName: Daily midnight build
branches:
include:
- master
- develop
- releases/*
- feature/*
always: true
steps:
- task: DotNetCoreInstaller@0
displayName: 'Install .NetCore SDK'
inputs:
version: 3.1.201
failOnStandardError: 'true'
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
displayName: Install rust
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: |
rustup install nightly
displayName: rustup install nightly
- script: |
rustup override set nightly
displayName: rustup override set nightly
- script: |
sudo apt-get install libsnappy-dev
displayName: Install snappy
condition: eq( variables['Agent.OS'], 'Linux' )
- script: |
brew install snappy
displayName: Install snappy
condition: eq( variables['Agent.OS'], 'Darwin' )
- 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 TestCategory!=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 TestCategory!=IntegrationTest --configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:UseSourceLink=true /p:Exclude="\"[Catalyst.Tools*]Catalyst.Tools*[Catalyst.Protocol*]Catalyst.Protocol*,[Catalyst.Simulator*]Catalyst.Simulator*,[Catalyst.TestUtils*]Catalyst.TestUtils*\"" /p:Include="\"[Catalyst.Core.*]Catalyst.Core.*,[Catalyst.Modules.*]Catalyst.Modules.*\"" /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 TestCategory=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.*;+Catalyst.Modules.*;"
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' )