irongut / CodeCoverageSummary

A GitHub Action that reads Cobertura format code coverage files and outputs a text or markdown summary.
MIT License
196 stars 56 forks source link

How to publish to Job Summary? #270

Open ranouf opened 8 months ago

ranouf commented 8 months ago

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/CodeCoverageSummary@v1.3.0
      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 commented 8 months ago

The file used was not the correct one:

  - name: Write to Job Summary
      run: cat **code-coverage-results.md** >> $GITHUB_STEP_SUMMARY
github-actions[bot] commented 5 months ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 30 days.

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 30 days.