This repository has been archived by the owner on Nov 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-pipelines.yaml
88 lines (77 loc) · 2.62 KB
/
azure-pipelines.yaml
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
variables :
- name: 'configuration'
value: 'Release'
- name: 'Parameters.projects'
value: '**/*.csproj'
- name: 'Parameters.projects.tests'
value: '**/*Tests.csproj'
- name: 'majorVersion'
value: '1'
- name: 'minorVersion'
value: '0'
- name: 'patchVersion'
value: '0'
- name : 'projectName'
value: 'MedEasy'
- name: 'minimumTestsCoverage'
value: 90
- name: 'coverletOutputFormat'
value: 'cobertura%2cjson'
pr:
autoCancel: true
branches:
include:
- master
trigger:
batch: false
branches:
include:
- master
- feature/*
- hotfix/*
paths:
exclude:
- README.md
- docs/*
pool:
vmImage: windows-latest
#Your build pipeline references an undefined variable named ‘Parameters.projects’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
#Your build pipeline references a secret variable named ‘github.apiKey’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab, and then select the option to make it secret. See https://go.microsoft.com/fwlink/?linkid=865972
steps:
- task: [email protected]
displayName: 'Restore packages'
inputs:
command: restore
projects: '$(Parameters.projects)'
feedsToUse: config
nugetConfigPath: Nuget.config
verbosityRestore: Normal
- task: [email protected]
displayName: 'Build projects'
inputs:
projects: '$(Parameters.projects)'
arguments: '--no-restore -c $(configuration)'
- task: [email protected]
displayName: 'Run tests and collect code coverage'
inputs:
command: test
projects: '$(Parameters.projects.tests)'
arguments: >-
--no-build -c $(configuration) --collect:"XPlat Code Coverage"
/p:CoverletOutput=$(Agent.TempDirectory)\ /p:CollectCoverage=true
/p:ExcludeByAttribute=Obsolete
/p:MergeWith="$(Agent.TempDirectory)\coverage.json"
/p:CoverletOutputFormat=cobertura
- task: [email protected]
inputs:
command: custom
custom: tool
arguments: install -g dotnet-reportgenerator-globaltool --ignore-failed-sources
displayName: Install ReportGenerator tool
- script: reportgenerator -reports:$(Agent.TempDirectory)\**\*.cobertura.xml -targetdir:$(Build.SourcesDirectory)\coverlet\reports -reporttypes:"Badges;Cobertura"
displayName: Create reports
- task: [email protected]
displayName: 'Publish code coverage'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: $(Build.SourcesDirectory)\coverlet\reports\Cobertura.xml