-
Notifications
You must be signed in to change notification settings - Fork 3
/
azure-pipelines.yml
62 lines (57 loc) · 1.88 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
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
strategy:
matrix:
windows:
imageName: 'windows-latest'
linux:
imageName: 'ubuntu-latest'
mac:
imageName: 'macos-latest'
trigger:
branches:
include:
- master
- develop
pool:
vmImage: $(imageName)
variables:
buildConfiguration: 'Release'
steps:
- task: UseDotNet@2
displayName: 'Install .NET SDK 6.0'
inputs:
packageType: 'sdk'
version: '6.0.x'
- bash: |
sudo apt-get update -y
sudo apt-get install libfuse3-3 -y
displayName: 'Install libfuse3'
condition: eq( variables['Agent.OS'], 'Linux' )
- task: DotNetCoreCLI@2
displayName: 'Restore Nuget Pacakges'
inputs:
command: 'restore'
projects: '**/*.csproj'
feedsToUse: 'select'
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'Build Projects'
- task: DotNetCoreCLI@2
displayName: 'Run Tests'
inputs:
command: 'test'
projects: '**/*.Tests/*.csproj'
arguments: '--configuration $(buildConfiguration) --logger="console;verbosity=detailed" --collect:"XPlat Code Coverage" --settings:"$(Build.SourcesDirectory)/coverlet.runsettings"'
# https://stackoverflow.com/questions/64592534/publish-a-pipeline-azure-devops-code-coverage-report
- task: DotNetCoreCLI@2
displayName: 'Install ReportGenerator Tool'
inputs:
command: 'custom'
custom: 'tool'
arguments: 'install --global dotnet-reportgenerator-globaltool'
- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:"$(Build.ArtifactStagingDirectory)/coverlet" -reporttypes:"Cobertura" -verbosity:"Verbose"'
displayName: 'Merge Code Coverage Reports'
- task: PublishCodeCoverageResults@1
displayName: 'Publish Code Coverage Report'
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(Build.ArtifactStagingDirectory)/coverlet/Cobertura.xml'