forked from linnoreading/lucky-draw-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
35 lines (28 loc) · 1.41 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
pool:
vmImage: 'windows-2019'
variables:
buildConfiguration: 'Release'
steps:
- script: |
dotnet build --configuration $(buildConfiguration)
- script: |
dotnet test test/LuckyDrawBot.Tests/LuckyDrawBot.Tests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:Exclude=\"[*]LuckyDrawBot.Program,[*]LuckyDrawBot.Services.BotClient,[*]LuckyDrawBot.Services.BotClientFactory,[*]LuckyDrawBot.Services.IDateTimeService,[*]Microsoft.*,[*]System.*,[*]LuckyDrawBot.Infrastructure.*,[*]LuckyDrawBot.Tests.Infrastructure.*,[xunit*]*\"
displayName: dotnet test
- script: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:$(Build.SourcesDirectory)/test/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/CodeCoverage -reporttypes:HtmlInline_AzurePipelines;Cobertura
displayName: Create Code coverage report
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/CodeCoverage/Cobertura.xml'
reportDirectory: '$(Build.SourcesDirectory)/CodeCoverage'
- task: DotNetCoreCLI@2
inputs:
command: publish
publishWebProjects: False
projects: 'src/LuckyDrawBot/LuckyDrawBot.csproj'
arguments: '--configuration $(BuildConfiguration) --output $(build.artifactstagingdirectory)'
zipAfterPublish: True
- task: PublishBuildArtifacts@1