Skip to content

Commit c5f5818

Browse files
committed
Upload coverage report to Codacy in addition to Codecov
1 parent 808cf80 commit c5f5818

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ jobs:
3535
run: dotnet build --verbosity normal
3636
- name: Run tests
3737
run: dotnet test --no-build --verbosity normal
38+
id: dotnet-test
39+
- name: Upload coverage report to Codacy
40+
uses: codacy/codacy-coverage-reporter-action@master
41+
with:
42+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
43+
coverage-reports: ${{ steps.dotnet-test.outputs.coverlet-reports }}
3844
- name: Create NuGet package
3945
run: dotnet pack --output . --no-build --verbosity normal
4046
id: dotnet-pack

tests/Serilog.Formatting.Log4Net.Tests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
<Exec WorkingDirectory="$(CoverageReportDirectory)" Command="$(OpenCommand) index.html" Condition="$(OpenCommand) != ''" IgnoreExitCode="true" />
4242
</Target>
4343

44+
<Target Name="PrintCoverletReportsForGitHubActions" AfterTargets="GenerateCoverageResultAfterTest">
45+
<Message Importance="high" Text="::set-output name=coverlet-reports::@(CoverletReport, ',')" />
46+
</Target>
47+
4448
<Target Name="UploadCoverageToCodecov" AfterTargets="GenerateCoverageResultAfterTest" Condition="$(ContinuousIntegrationBuild) == 'true'">
4549
<!-- For reference: the file `.config/dotnet-tools.json` was created by running `dotnet new tool-manifest && dotnet tool install Codecov.Tool` -->
4650
<Exec Command="dotnet tool restore" />

0 commit comments

Comments
 (0)