diff --git a/.github/workflows/build-library.yml b/.github/workflows/build-library.yml index 94ea691..f26cc1a 100644 --- a/.github/workflows/build-library.yml +++ b/.github/workflows/build-library.yml @@ -83,8 +83,33 @@ jobs: -p:PackageVersion=$BUILD_VERSION -p:Version=$BUILD_VERSION --no-build - --verbosity minimal - --logger trx --collect:"XPlat Code Coverage" + --verbosity minimal + --logger trx + --collect:"XPlat Code Coverage" + + - name: Combine coverage reports + uses: danielpalme/ReportGenerator-GitHub-Action@5.2.4 + with: + reports: "**/coverage.cobertura.xml" + assemblyfilters: "-*Test*" + targetdir: "${{ github.workspace }}/TestResults" + reporttypes: "Cobertura;lcov;MarkdownSummaryGithub" + verbosity: "Info" + title: "Code Coverage" + tag: "${{ github.run_number }}_${{ github.run_id }}" + customSettings: "" + toolpath: "reportgeneratortool" + + - name: Add code coverage summary to job + if: always() + run: cat "${{ github.workspace }}/TestResults/SummaryGithub.md" >> $GITHUB_STEP_SUMMARY + + - name: Upload code coverage reports + uses: actions/upload-artifact@v4 + with: + name: coverage + path: ${{ github.workspace }}/TestResults + retention-days: 7 - name: Pack NuGet libraries run: > @@ -110,61 +135,7 @@ jobs: if-no-files-found: error path: | ${{ github.workspace }}/.github/workflows/SignedPackageFileList.txt - - - name: Upload test results - if: always() - uses: actions/upload-artifact@v4 - with: - name: test-results - if-no-files-found: error - path: ${{ github.workspace }}/**/TestResults/*.trx - retention-days: 7 - - # - name: Publish test results - # uses: EnricoMi/publish-unit-test-result-action@v2.18.0 - # if: ${{ always() && github.event_name == 'pull_request' }} - # with: - # files: "${{ github.workspace }}/**/*.trx" - - - name: Combine coverage reports - uses: danielpalme/ReportGenerator-GitHub-Action@5.2.4 - with: - reports: "**/*.cobertura.xml" - targetdir: "${{ github.workspace }}" - reporttypes: "Cobertura" - verbosity: "Info" - title: "Code Coverage" - tag: "${{ github.run_number }}_${{ github.run_id }}" - customSettings: "" - toolpath: "reportgeneratortool" - - - name: Upload combined coverage XML - uses: actions/upload-artifact@v4 - with: - name: coverage - path: ${{ github.workspace }}/Cobertura.xml - retention-days: 7 - - - name: Publish code coverage report - uses: irongut/CodeCoverageSummary@v1.3.0 - with: - filename: "Cobertura.xml" - badge: true - fail_below_min: false - format: markdown - hide_branch_rate: false - hide_complexity: false - indicators: true - output: both - thresholds: "10 30" - - - name: Upload combined coverage markdown - uses: actions/upload-artifact@v4 - with: - name: coverage-markdown - path: ${{ github.workspace }}/code-coverage-results.md - retention-days: 7 - + sign: needs: [build] if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}