-
Notifications
You must be signed in to change notification settings - Fork 7
/
azure-pipelines.yml
95 lines (82 loc) · 2.81 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
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
pool:
name: Azure Pipelines
vmImage: windows-latest # other valid values include: 'windows-latest' | 'macOS-latest'
demands:
- msbuild
- visualstudio
- vstest
jobs:
- job: Build
variables:
BuildSolution: src\FibulaMMO.sln
BuildPlatform: Any CPU
strategy:
matrix:
Debug:
BuildConfiguration: Debug
_debugArg: '-Debug'
Release:
BuildConfiguration: Release
_debugArg: ''
steps:
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
version: '3.0.x'
packageType: runtime
performMultiLevelLookup: true
includePreviewVersions: true # Required for preview versions
- task: DotNetCoreCLI@2
displayName: 'Install Codecov.Tool'
inputs:
command: custom
custom: tool
arguments: 'install -g Codecov.Tool'
- task: DotNetCoreCLI@2
displayName: 'Install ReportGenerator'
inputs:
command: custom
custom: tool
arguments: 'install -g dotnet-reportgenerator-globaltool'
- task: NuGetToolInstaller@0
displayName: 'Use NuGet 5.3.1'
inputs:
versionSpec: 5.3.1
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: '$(BuildSolution)'
feedsToUse: 'config'
nugetConfigPath: 'NuGet.config'
- task: VSBuild@1
displayName: 'Build solution FibulaMMO.sln'
inputs:
solution: '$(BuildSolution)'
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: '/bl'
- task: DotNetCoreCLI@2
displayName: 'Run Tests'
inputs:
command: test
arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutput=$(Agent.TempDirectory)/TestResults/ /p:CoverletOutputFormat=cobertura'
projects: '**/*.Tests/*.csproj'
- script: reportgenerator "-reports:$(Agent.TempDirectory)\TestResults\**\coverage.cobertura.xml" "-targetdir:$(Agent.TempDirectory)\CodeCoverage" "-reporttypes:HtmlInline_AzurePipelines;Cobertura"
condition: succeededOrFailed()
displayName: 'Create Code coverage report'
- task: PublishCodeCoverageResults@1
condition: succeededOrFailed()
displayName: 'Upload Code Coverage report to Azure Pipelines'
inputs:
codecoverageTool: cobertura
failIfCoverageEmpty: true
summaryFileLocation: $(Agent.TempDirectory)\CodeCoverage\Cobertura.xml
- script: codecov -f $(Agent.TempDirectory)\CodeCoverage\Cobertura.xml -t $(CodeCov_Token)
condition: succeededOrFailed()
displayName: 'Upload Code Coverage report to CodeCov.io'