-
-
Notifications
You must be signed in to change notification settings - Fork 82
/
azure-pipelines.yml
118 lines (115 loc) · 3.57 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
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
variables:
buildConfiguration: 'Release'
netSdkVersion: '8.x'
jobs:
# - job: BuildAndRunCodeAnalysis
# displayName: Build and run code analysis
# pool:
# vmImage: ubuntu-latest
# steps:
# - task: UseDotNet@2
# displayName: Set up .NET SDK
# inputs:
# version: $(netSdkVersion)
# - task: DotNetCoreCLI@2
# displayName: Build solution with code analysis
# inputs:
# command: build
# projects: '*.sln'
# arguments: -c $(buildConfiguration) -warnaserror
- job: RunTestsOnUbuntu
displayName: Run tests on Ubuntu
pool:
vmImage: ubuntu-latest
steps:
- task: UseDotNet@2
displayName: Set up .NET SDK
inputs:
version: $(netSdkVersion)
- task: DotNetCoreCLI@2
displayName: Build solution
inputs:
command: build
projects: '*.sln'
arguments: -c $(buildConfiguration) -p:RunAnalyzers=false
- task: DotNetCoreCLI@2
displayName: Install dotnet-coverage
inputs:
command: custom
custom: tool
arguments: install -g dotnet-coverage
- task: DotNetCoreCLI@2
displayName: Run unit tests
timeoutInMinutes: 3
inputs:
command: test
projects: 'test/*/*.UnitTests.csproj'
arguments: -c $(buildConfiguration) -s "azure-pipelines.codecoverage.runsettings" --no-build
- task: DotNetCoreCLI@2
displayName: Run integration tests
condition: succeededOrFailed()
timeoutInMinutes: 20
inputs:
command: test
projects: 'test/*/*.IntegrationTests*.csproj'
arguments: -c $(buildConfiguration) -s "azure-pipelines.codecoverage.runsettings" --no-build
- task: Bash@3
displayName: Merge coverage results
condition: succeededOrFailed()
inputs:
targetType: inline
script: dotnet-coverage merge "**/*.coverage" -f cobertura -o merged.cobertura.xml --remove-input-files
workingDirectory: $(Agent.TempDirectory)
- task: PublishCodeCoverageResults@2
displayName: Publish code coverage results
condition: succeededOrFailed()
inputs:
summaryFileLocation: $(Agent.TempDirectory)/merged.cobertura.xml
- task: PublishPipelineArtifact@1
displayName: Publish test artifacts
condition: succeededOrFailed()
inputs:
artifactName: Artifacts-ubuntu-latest
targetPath: test/Atata.IntegrationTests/bin/$(buildConfiguration)/net8.0/artifacts
- job: RunTestsOnWindowsAndMacOS
displayName: Run tests on
strategy:
matrix:
Windows:
imageName: windows-latest
macOS:
imageName: macOS-latest
pool:
vmImage: $(imageName)
steps:
- task: UseDotNet@2
displayName: Set up .NET SDK
inputs:
version: $(netSdkVersion)
- task: DotNetCoreCLI@2
displayName: Build solution
inputs:
command: build
projects: '*.sln'
arguments: -c $(buildConfiguration) -p:RunAnalyzers=false
- task: DotNetCoreCLI@2
displayName: Run unit tests
timeoutInMinutes: 3
inputs:
command: test
projects: 'test/*/*UnitTests.csproj'
arguments: -c $(buildConfiguration) -s "azure-pipelines.runsettings" --no-build
- task: DotNetCoreCLI@2
displayName: Run integration tests
condition: succeededOrFailed()
timeoutInMinutes: 20
inputs:
command: test
projects: 'test/*/*.IntegrationTests*.csproj'
arguments: -c $(buildConfiguration) -s "azure-pipelines.runsettings" --no-build
- task: PublishPipelineArtifact@1
displayName: Publish test artifacts
condition: succeededOrFailed()
inputs:
artifactName: Artifacts-$(imageName)
targetPath: test/Atata.IntegrationTests/bin/$(buildConfiguration)/net8.0/artifacts