forked from justeattakeaway/JustSaying
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.targets
14 lines (14 loc) · 1.63 KB
/
Directory.Build.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<Project>
<PropertyGroup Condition=" '$(CollectCoverage)' == 'true' ">
<ReportGeneratorOutputMarkdown Condition=" '$(ReportGeneratorOutputMarkdown)' == '' AND '$(GITHUB_SHA)' != '' ">true</ReportGeneratorOutputMarkdown>
<ReportGeneratorReportTypes>HTML</ReportGeneratorReportTypes>
<ReportGeneratorReportTypes Condition=" '$(ReportGeneratorOutputMarkdown)' == 'true' ">$(ReportGeneratorReportTypes);MarkdownSummaryGitHub</ReportGeneratorReportTypes>
<ReportGeneratorTargetDirectory>$([System.IO.Path]::Combine($(OutputPath), 'coverage'))</ReportGeneratorTargetDirectory>
<_MarkdownSummaryPrefix><details><summary>:chart_with_upwards_trend: <b>$(AssemblyName) Code Coverage report</b></summary></_MarkdownSummaryPrefix>
<_MarkdownSummarySuffix></details></_MarkdownSummarySuffix>
</PropertyGroup>
<Target Name="GenerateCoverageReports" AfterTargets="GenerateCoverageResultAfterTest" Condition=" '$(CollectCoverage)' == 'true' ">
<ReportGenerator ReportFiles="@(CoverletReport)" ReportTypes="$(ReportGeneratorReportTypes)" Tag="$(Version)" TargetDirectory="$(ReportGeneratorTargetDirectory)" Title="$(AssemblyName)" VerbosityLevel="Warning" />
<Exec Condition=" '$(ReportGeneratorOutputMarkdown)' == 'true' " Command="pwsh -Command %22('$(_MarkdownSummaryPrefix)' + [System.Environment]::NewLine + [System.Environment]::NewLine + (Get-Content $([System.IO.Path]::Combine($(ReportGeneratorTargetDirectory), 'SummaryGithub.md')) | Out-String) + [System.Environment]::NewLine + [System.Environment]::NewLine + '$(_MarkdownSummarySuffix)') >> $(GITHUB_STEP_SUMMARY)%22" />
</Target>
</Project>