@@ -21,12 +21,42 @@ jobs:
2121 steps :
2222 - name : Checkout
232324- - name : Unit Test with Coverage
25- run : dotnet test test/UnitTest --collect:"XPlat Code Coverage" --results-directory ./coverage
26- - name : Upload coverage reports to Codecov
27- 24+ - name : Unit Test
25+ run : dotnet test test/UnitTest --configuration Release --logger trx --collect:"XPlat Code Coverage;Format=cobertura" --results-directory ./TestResults/
26+ - name : Combine Coverage Reports # This is because one report is produced per project, and we want one result for all of them.
27+ uses :
danielpalme/[email protected] 28+ with :
29+ reports : ' **/*.cobertura.xml' # REQUIRED # The coverage reports that should be parsed (separated by semicolon). Globbing is supported.
30+ targetdir : " ${{ github.workspace }}" # REQUIRED # The directory where the generated report should be saved.
31+ reporttypes : ' HtmlInline;Cobertura'
32+ - name : Publish Code Coverage Report
33+ 34+ with :
35+ filename : " Cobertura.xml"
36+ badge : true
37+ fail_below_min : false # just informative for now
38+ format : markdown
39+ hide_branch_rate : false
40+ hide_complexity : false
41+ indicators : true
42+ output : both
43+ thresholds : " 10 30"
44+ - name : Add Coverage PR Comment
45+ uses : marocchino/sticky-pull-request-comment@v2
46+ if : github.event_name == 'pull_request'
47+ with :
48+ recreate : true
49+ path : code-coverage-results.md
50+ - name : Upload Test Result Files
51+ uses : actions/upload-artifact@v4
52+ with :
53+ name : test-results
54+ path : |
55+ ${{ github.workspace }}/**/TestResults/**/*
56+ ${{ github.workspace }}/**/CoverageReports/**/*
57+ retention-days : 5
58+ - name : Publish Test Results
59+ 60+ if : always()
2861 with :
29- directory : ./coverage
30- fail_ci_if_error : false
31- env :
32- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
62+ trx_files : " ${{ github.workspace }}/**/*.trx"
0 commit comments