Skip to content

Commit b69993c

Browse files
committed
Upload coverage report to Codecov from GitHub actions
So that CI doesn't fail if Codecov is having issues.
1 parent 1eeac5b commit b69993c

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ jobs:
2626
uses: actions/checkout@v2
2727
with:
2828
fetch-depth: 0
29-
- name: Set UploadCoverageReport environment variable to true
30-
if: matrix.os == 'macos-latest'
31-
run: echo "UploadCoverageReport=true" >> $GITHUB_ENV
3229
- name: Retrieve cached NuGet packages
3330
uses: actions/cache@v2
3431
with:
@@ -53,6 +50,17 @@ jobs:
5350
with:
5451
name: TestResults-${{ runner.os }}
5552
path: TestResults-${{ runner.os }}.html
53+
- name: Upload coverage report to Codecov
54+
if: matrix.os == 'macos-latest'
55+
uses: codecov/codecov-action@v2
56+
with:
57+
files: ${{ steps.dotnet-test.outputs.coverage-reports }}
58+
- name: Upload coverage report to Codacy
59+
if: matrix.os == 'macos-latest'
60+
uses: codacy/codacy-coverage-reporter-action@v1
61+
with:
62+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
63+
coverage-reports: ${{ steps.dotnet-test.outputs.coverage-reports }}
5664
- name: Run mutation tests and upload report to Stryker dashboard
5765
if: matrix.os == 'macos-latest'
5866
# Once https://github.com/stryker-mutator/stryker-net/pull/1663 is merged and Stryker.NET v1.0 is released
@@ -62,18 +70,12 @@ jobs:
6270
cd tests
6371
dotnet tool restore
6472
dotnet tool run dotnet-stryker --reporters '["progress","dashboard"]' --dashboard-project github.com/serilog-contrib/serilog-formatting-log4net --dashboard-version ${GITHUB_REF#refs/heads/} --dashboard-api-key ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
65-
- name: Upload coverage report to Codacy
66-
uses: codacy/codacy-coverage-reporter-action@v1
67-
if: matrix.os == 'macos-latest'
68-
with:
69-
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
70-
coverage-reports: ${{ steps.dotnet-test.outputs.coverage-reports }}
7173
- name: Create NuGet package
7274
run: dotnet pack --no-build --output .
7375
id: dotnet-pack
7476
- name: Upload NuGet package artifact
75-
uses: actions/upload-artifact@v2
7677
if: matrix.os == 'macos-latest'
78+
uses: actions/upload-artifact@v2
7779
with:
7880
name: ${{ steps.dotnet-pack.outputs.nupkg-filename }}
7981
path: ${{ steps.dotnet-pack.outputs.nupkg-filename }}

tests/Serilog.Formatting.Log4Net.Tests.csproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="ApprovalTests" Version="5.7.0" />
12-
<PackageReference Include="Codecov.MSBuild" Version="1.13.0" />
1312
<PackageReference Include="coverlet.msbuild" Version="3.1.0" PrivateAssets="all" />
1413
<PackageReference Include="FluentAssertions" Version="6.1.0" />
1514
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
@@ -46,10 +45,6 @@
4645
<Message Importance="high" Text="::set-output name=coverage-reports::@(CoverletReport, ',')" />
4746
</Target>
4847

49-
<Target Name="UploadCoverageToCodecov" AfterTargets="GenerateCoverageResultAfterTest" Condition="$(UploadCoverageReport) == 'true'">
50-
<Codecov ReportFiles="@(CoverletReport)" />
51-
</Target>
52-
5348
<ItemGroup>
5449
<ProjectReference Include="../src/Serilog.Formatting.Log4Net.csproj" />
5550
</ItemGroup>

0 commit comments

Comments
 (0)