CodeCoverageSummary icon indicating copy to clipboard operation
CodeCoverageSummary copied to clipboard

How to publish to Job Summary?

Open ranouf opened this issue 1 year ago • 3 comments

Hi,

Here is the YML I use to test, create a report and display the report to Job Summary:

  # Test .NET project
   - name: Test .NET project
     run: dotnet test --no-build --settings tests.runsettings --results-directory ./coverage -- "RunConfiguration.DisableAppDomain=true"
     
   # Generate Summary Report
   - name: Code Coverage Summary Report
     uses: irongut/[email protected]
     with:
       filename: coverage/**/coverage.cobertura.xml
       badge: true
       format: 'markdown'
       output: 'both'

   - name: Write to Job Summary
     run: cat CodeCoverage/SummaryGithub.md >> $GITHUB_STEP_SUMMARY

But I have an issue:

Run cat CodeCoverage/SummaryGithub.md >> $GITHUB_STEP_SUMMARY
cat: CodeCoverage/SummaryGithub.md: No such file or directory
Error: Process completed with exit code 1.

How can I publish the report in Job Summary (not as a comment)?

Thanks

ranouf avatar Mar 12 '24 19:03 ranouf

The file used was not the correct one:

- name: Write to Job Summary
    run: cat **code-coverage-results.md** >> $GITHUB_STEP_SUMMARY

ranouf avatar Mar 12 '24 19:03 ranouf