|
26 | 26 | run: |
|
27 | 27 | scripts/DisableStrongName.ps1
|
28 | 28 |
|
29 |
| - - name: Setup .NET 8.x |
| 29 | + - name: Setup .NET |
30 | 30 | uses: actions/setup-dotnet@v3
|
31 | 31 | with:
|
32 | 32 | # Semantic version range syntax or exact version of a dotnet version
|
@@ -71,28 +71,57 @@ jobs:
|
71 | 71 | pull-requests: write
|
72 | 72 | if: ${{ always() && needs.Build.result == 'success' }}
|
73 | 73 | steps:
|
| 74 | + - name: Check out repository code |
| 75 | + uses: actions/checkout@v4 |
| 76 | + with: |
| 77 | + fetch-depth: 1 # Don't need full history for this job |
| 78 | + |
74 | 79 | - name: Download Code Coverage
|
75 | 80 | uses: actions/download-artifact@v4
|
76 | 81 | with:
|
77 | 82 | name: CodeCoverage
|
78 | 83 | path: TestResults
|
79 | 84 |
|
| 85 | + - name: Setup .NET |
| 86 | + uses: actions/setup-dotnet@v3 |
| 87 | + with: |
| 88 | + dotnet-version: '8.x' |
| 89 | + dotnet-quality: 'ga' |
| 90 | + |
| 91 | + - name: ReportGenerator |
| 92 | + uses: danielpalme/[email protected] |
| 93 | + with: |
| 94 | + reports: TestResults/**/coverage.cobertura.xml |
| 95 | + targetdir: CodeCoverageReport |
| 96 | + sourcedirs: src |
| 97 | + reporttypes: HtmlInline;MarkdownSummaryGithub;Cobertura |
| 98 | + |
| 99 | + - name: Upload coverage report artifact |
| 100 | + uses: actions/upload-artifact@v4 |
| 101 | + with: |
| 102 | + name: CodeCoverageReport # Artifact name |
| 103 | + path: CodeCoverageReport # Directory containing files to upload |
| 104 | + |
80 | 105 | - name: Code Coverage Report
|
81 | 106 |
|
82 | 107 | with:
|
83 |
| - filename: TestResults/**/coverage.cobertura.xml |
| 108 | + filename: CodeCoverageReport/Cobertura.xml |
84 | 109 | badge: true
|
85 | 110 | fail_below_min: true
|
86 | 111 | format: markdown
|
87 | 112 | hide_branch_rate: false
|
88 | 113 | hide_complexity: true
|
89 | 114 | indicators: true
|
90 | 115 | output: both
|
91 |
| - thresholds: '17 80' |
| 116 | + thresholds: '25 80' |
92 | 117 |
|
93 | 118 | - name: Add Coverage PR Comment
|
94 | 119 | uses: marocchino/sticky-pull-request-comment@v2
|
95 | 120 | if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
|
96 | 121 | with:
|
97 | 122 | recreate: true
|
98 | 123 | path: code-coverage-results.md
|
| 124 | + |
| 125 | + - name: Publish coverage in build summary # Only applicable if 'MarkdownSummaryGithub' or one of the other Markdown report types is generated |
| 126 | + run: cat CodeCoverageReport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY # Adjust path and filename if necessary |
| 127 | + shell: bash |
0 commit comments