|
1 |
| -name: Code Coverage |
2 |
| - |
3 |
| -on: |
4 |
| - workflow_call: |
5 |
| - |
6 |
| -jobs: |
7 |
| - publish-coverage: |
8 |
| - runs-on: ubuntu-latest |
9 |
| - steps: |
10 |
| - - uses: actions/checkout@v4 |
11 |
| - - name: Setup .NET |
12 |
| - uses: actions/setup-dotnet@v4 |
13 |
| - with: |
14 |
| - dotnet-version: | |
15 |
| - 9.0.x |
16 |
| - 8.0.x |
17 |
| -
|
18 |
| - - name: Download test results |
19 |
| - uses: actions/download-artifact@v4 |
20 |
| - with: |
21 |
| - pattern: testresults-* |
22 |
| - |
23 |
| - - name: Combine coverage reports |
24 |
| - uses: danielpalme/[email protected] |
25 |
| - with: |
26 |
| - reports: "**/*.cobertura.xml" |
27 |
| - targetdir: "${{ github.workspace }}/report" |
28 |
| - reporttypes: "HtmlSummary;Cobertura;MarkdownSummary;MarkdownSummaryGithub" |
29 |
| - verbosity: "Info" |
30 |
| - title: "Code Coverage" |
31 |
| - tag: "${{ github.run_number }}_${{ github.run_id }}" |
32 |
| - customSettings: "" |
33 |
| - toolpath: "reportgeneratortool" |
34 |
| - |
35 |
| - - name: Upload combined coverage XML |
36 |
| - uses: actions/upload-artifact@v4 |
37 |
| - with: |
38 |
| - name: coverage |
39 |
| - path: ${{ github.workspace }}/report |
40 |
| - retention-days: 7 |
41 |
| - |
42 |
| - - name: Publish code coverage report |
43 |
| - |
44 |
| - with: |
45 |
| - filename: "report/Cobertura.xml" |
46 |
| - badge: true |
47 |
| - fail_below_min: true |
48 |
| - format: markdown |
49 |
| - hide_branch_rate: false |
50 |
| - hide_complexity: false |
51 |
| - indicators: true |
52 |
| - output: both |
53 |
| - thresholds: "60 80" |
54 |
| - |
55 |
| - - name: Upload combined coverage markdown |
56 |
| - uses: actions/upload-artifact@v4 |
57 |
| - with: |
58 |
| - name: coverage-markdown |
59 |
| - path: ${{ github.workspace }}/code-coverage-results.md |
60 |
| - retention-days: 7 |
61 |
| - |
62 |
| - - name: Add Coverage PR Comment |
63 |
| - uses: marocchino/sticky-pull-request-comment@v2 |
64 |
| - if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository |
65 |
| - with: |
66 |
| - recreate: true |
67 |
| - path: ${{ github.workspace }}/code-coverage-results.md |
68 |
| - |
69 |
| - - name: Coverage on step summary |
70 |
| - if: always() |
71 |
| - run: cat "${{ github.workspace }}/report/SummaryGithub.md" >> $GITHUB_STEP_SUMMARY |
| 1 | +name: Code Coverage |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + |
| 6 | +jobs: |
| 7 | + publish-coverage: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v4 |
| 11 | + - name: Setup .NET |
| 12 | + uses: actions/setup-dotnet@v4 |
| 13 | + with: |
| 14 | + dotnet-version: | |
| 15 | + 9.0.x |
| 16 | + 8.0.x |
| 17 | +
|
| 18 | + - name: Download test results |
| 19 | + uses: actions/download-artifact@v4 |
| 20 | + with: |
| 21 | + pattern: testresults-* |
| 22 | + |
| 23 | + - name: Combine coverage reports |
| 24 | + uses: danielpalme/[email protected] |
| 25 | + with: |
| 26 | + reports: "**/*.cobertura.xml" |
| 27 | + targetdir: "${{ github.workspace }}/report" |
| 28 | + reporttypes: "HtmlSummary;Cobertura;MarkdownSummary;MarkdownSummaryGithub" |
| 29 | + verbosity: "Info" |
| 30 | + title: "Code Coverage" |
| 31 | + tag: "${{ github.run_number }}_${{ github.run_id }}" |
| 32 | + customSettings: "" |
| 33 | + toolpath: "reportgeneratortool" |
| 34 | + |
| 35 | + - name: Upload combined coverage XML |
| 36 | + uses: actions/upload-artifact@v4 |
| 37 | + with: |
| 38 | + name: coverage |
| 39 | + path: ${{ github.workspace }}/report |
| 40 | + retention-days: 7 |
| 41 | + |
| 42 | + - name: Publish code coverage report |
| 43 | + |
| 44 | + with: |
| 45 | + filename: "report/Cobertura.xml" |
| 46 | + badge: true |
| 47 | + fail_below_min: true |
| 48 | + format: markdown |
| 49 | + hide_branch_rate: false |
| 50 | + hide_complexity: false |
| 51 | + indicators: true |
| 52 | + output: both |
| 53 | + thresholds: "60 80" |
| 54 | + |
| 55 | + - name: Upload combined coverage markdown |
| 56 | + uses: actions/upload-artifact@v4 |
| 57 | + with: |
| 58 | + name: coverage-markdown |
| 59 | + path: ${{ github.workspace }}/code-coverage-results.md |
| 60 | + retention-days: 7 |
| 61 | + |
| 62 | + - name: Add Coverage PR Comment |
| 63 | + uses: marocchino/sticky-pull-request-comment@v2 |
| 64 | + if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository |
| 65 | + with: |
| 66 | + recreate: true |
| 67 | + path: ${{ github.workspace }}/code-coverage-results.md |
| 68 | + |
| 69 | + - name: Coverage on step summary |
| 70 | + if: always() |
| 71 | + run: cat "${{ github.workspace }}/report/SummaryGithub.md" >> $GITHUB_STEP_SUMMARY |
0 commit comments