Skip to content

Commit 12d7ee8

Browse files
committed
2 parents bde5370 + fcbec70 commit 12d7ee8

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

azure-pipelines.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# ASP.NET Core
2+
# Build and test ASP.NET Core projects targeting .NET Core.
3+
# Add steps that run tests, create a NuGet package, deploy, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
5+
6+
trigger:
7+
- master
8+
9+
pool:
10+
vmImage: 'ubuntu-latest'
11+
12+
variables:
13+
buildConfiguration: 'Release'
14+
15+
steps:
16+
- script: dotnet build --configuration $(buildConfiguration)
17+
displayName: 'dotnet build $(buildConfiguration)'
18+
19+
- task: DotNetCoreCLI@2
20+
inputs:
21+
command: test
22+
projects: '**/*Test/*.csproj'
23+
arguments: '--configuration $(buildConfiguration)'
24+
25+
- task: DotNetCoreCLI@2
26+
inputs:
27+
command: test
28+
projects: portent.Test/portent.Test.csproj
29+
arguments: -c $(buildConfiguration) --collect:"XPlat Code Coverage" -- RunConfiguration.DisableAppDomain=true
30+
displayName: Run Tests
31+
32+
- task: DotNetCoreCLI@2
33+
inputs:
34+
command: custom
35+
custom: tool
36+
arguments: install --tool-path . dotnet-reportgenerator-globaltool
37+
displayName: Install ReportGenerator tool
38+
39+
- script: ./reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/coverlet/reports -reporttypes:"Cobertura"
40+
displayName: Create reports
41+
42+
- task: PublishCodeCoverageResults@1
43+
displayName: 'Publish code coverage'
44+
inputs:
45+
codeCoverageTool: Cobertura
46+
summaryFileLocation: $(Build.SourcesDirectory)/coverlet/reports/Cobertura.xml

portent.Test/portent.Test.csproj

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
</PropertyGroup>
1515

1616
<ItemGroup>
17+
<PackageReference Include="coverlet.collector" Version="1.1.0">
18+
<PrivateAssets>all</PrivateAssets>
19+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
20+
</PackageReference>
1721
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0-preview-20190828-03" />
1822
<PackageReference Include="xunit" Version="2.4.1" />
1923
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">

0 commit comments

Comments
 (0)