Skip to content

Commit cf5e683

Browse files
committed
Add code coverage to GitHub actions
1 parent fb68152 commit cf5e683

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ jobs:
2222
run: dotnet build --configuration Release --no-restore
2323
- name: Test
2424
run: dotnet test --configuration Release --no-build --logger trx --results-directory TestResults --collect:"XPlat Code Coverage"
25+
- name: Upload coverage to Codecov
26+
uses: codecov/codecov-action@v3
27+
with:
28+
directory: ./TestResults
2529
- name: Upload test results
2630
uses: actions/upload-artifact@v3
2731
with:

.github/workflows/pr.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ jobs:
2020
run: dotnet build --configuration Release --no-restore
2121
- name: Test
2222
run: dotnet test --configuration Release --no-build --logger trx --results-directory TestResults --collect:"XPlat Code Coverage"
23+
- name: Upload coverage to Codecov
24+
uses: codecov/codecov-action@v3
25+
with:
26+
directory: ./TestResults
2327
- name: Upload test results
2428
uses: actions/upload-artifact@v3
2529
with:

Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323

2424
<!-- Enable implicit usings -->
2525
<ImplicitUsings>Enable</ImplicitUsings>
26+
27+
<!-- Required for code coverage -->
28+
<DebugType>Full</DebugType>
2629
</PropertyGroup>
2730

2831
<!-- Packaging -->

0 commit comments

Comments
 (0)