-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
52 lines (49 loc) · 2.02 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
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
variables:
sln: "./BlackjackGame.sln"
tests: "./MyApp.Tests/MyApp.Tests.csproj"
parameters:
- name: operatingSystems
type: object
default:
- name: Ubuntu
vmImage: ubuntu-latest
- name: Windows
vmImage: windows-latest
- name: macOS
vmImage: macOS-latest
- name: configurations
type: object
default:
- Debug
- Release
jobs:
- ${{ each conf in parameters.configurations }}:
- ${{ each os in parameters.operatingSystems }}:
- job: job${{ os.name }}${{ conf }}
displayName: ${{ conf }} (${{ os.name }})
pool:
vmImage: ${{ os.vmImage }}
steps:
- task: DotNetCoreCLI@2
displayName: Build solution (${{ os.name }} ${{ conf }})
inputs:
command: build
projects: $(sln)
arguments: --configuration ${{ conf }} --nologo
- task: DotNetCoreCLI@2
displayName: Run tests (${{ os.name }} ${{ conf }})
inputs:
command: test
projects: $(tests)
arguments: --configuration ${{ conf }} --blame-hang-timeout 60sec --no-build --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
publishTestResults: true
- script: "dotnet tool install --global dotnet-reportgenerator-globaltool"
displayName: "Install ReportGenerator tool"
- script: 'reportgenerator -reports:**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverage-report -reporttypes:"Cobertura"'
displayName: "Create coverage reports"
- task: PublishCodeCoverageResults@1
displayName: "Publish code coverage report"
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: "$(Build.SourcesDirectory)/coverage-report/Cobertura.xml"