diff --git a/.github/workflows/build_verification_dotnet.yml b/.github/workflows/build_verification_dotnet.yml index 810cfa4..be01765 100644 --- a/.github/workflows/build_verification_dotnet.yml +++ b/.github/workflows/build_verification_dotnet.yml @@ -84,7 +84,6 @@ jobs: - name: Run unit tests if: ${{ inputs.run_tests == true }} run: | - dotnet test ${{ env.TEST_PROJECT_PATH }} --configuration Debug --logger "trx;LogFileName=test-results.trx" dotnet test ${{ env.TEST_PROJECT_PATH }} --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage # A custom label can be generated to differentiate between multiple tests in the same action run @@ -118,13 +117,20 @@ jobs: max-annotations: "50" fail-on-error: "true" + # Execute the unit tests + - name: Run coverage tests + if: ${{ inputs.report_coverage == true }} + run: | + dotnet test ${{ env.TEST_PROJECT_PATH }} --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage + # Report coverage summary to the user - name: Code Coverage Report uses: irongut/CodeCoverageSummary@v1.3.0 + if: ${{ inputs.report_coverage == true }} with: filename: coverage/**/coverage.cobertura.xml badge: true - fail_below_min: true + fail_below_min: false format: markdown hide_branch_rate: false hide_complexity: true