Skip to content

Question: is it possible to show coverage report on Pull Request page #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
antonshell opened this issue Feb 12, 2021 · 5 comments
Closed

Comments

@antonshell
Copy link

antonshell commented Feb 12, 2021

Hello,

I'm tryed to use this github action. Added it to my tests workflow.
It works fine, but I don't understand how to see the report.

image

In general, I would like to see in Pull Request page.
There is another action: https://github.com/marketplace/actions/clover-code-coverage-report
And there is a posting the comment with report. Is it possible to do something like that?

image

@danielpalme
Copy link
Owner

You can publish the report as an artifact:

    - name: Upload coverage report artifact
      uses: actions/upload-artifact@v1.0.0
      with:
        name: CoverageReport # Artifact name        
        path: coverage # Directory containing files to upload

@antonshell
Copy link
Author

Ok, thank you! Will try

@revenue-nikhil-sharma
Copy link

revenue-nikhil-sharma commented Jun 16, 2021

Hi @danielpalme , can we only publish the artifacts and not see the report on pull request?
Though on downloading-extracting the artifiacts, it shows me all the relevant files.
Am I missing something?

@danielpalme
Copy link
Owner

My extension "just" generates the report. It does not add any information to your PRs.

@danielpalme
Copy link
Owner

You may want to give this extension a try: https://github.com/marketplace/actions/sticky-pull-request-comment

The workflow would look similar to this:

- name: ReportGenerator
  uses: danielpalme/ReportGenerator-GitHub-Action@4.8.12
  with:
    reports: 'coverage.xml'
    targetdir: 'coveragereport'
    reporttypes: 'HtmlInline;Cobertura;MarkdownSummary' 

- name: Publish coverage summary
  uses: marocchino/sticky-pull-request-comment@v2
  with:
    path: coveragereport/Summary.md

See also: danielpalme/ReportGenerator#431

disouzam added a commit to disouzam/Palindromes that referenced this issue Oct 8, 2023
disouzam added a commit to disouzam/Palindromes that referenced this issue Oct 9, 2023
Add custom test task

Commits:

1. **20152c9** Fixed status badge again
1. **bd426d0** Removed extra blank lines on workflow file
1. **6ffb1c1** Added a new test with custom command based on previous experience in Azure DevOps and in some docs
    References:
    - https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#defaultsrun
1. **f45f9a2** Fixed command syntax for task Test complete
1. **0f52b8f** Add full path to action that run a complete version of tests
1. **c6070f1** Fixed command to run a custom action to run tests and generate coverage report
1. **6fa607e** Renamed main job, action for ConsoleApp tests execution and added a new task to run Palindromes tests
    References:
    - https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow
    - https://docs.github.com/en/actions/creating-actions/about-custom-actions
    - https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions
1. **750f42e** Added report generator action
    Reference:
    - https://github.com/marketplace/actions/reportgenerator
1. **399d078** Fixed path to opencover report
1. **80094b9** Removed generic test action added on action creation in GitHub UI
1. **db26998** Added a default working directory
    References:
    - https://docs.github.com/en/actions/learn-github-actions/essential-features-of-github-actions
    - https://stackoverflow.com/questions/58139175/running-actions-in-another-directory
1. **69cf584** Added an action to display path
1. **95f0cd7** Trying another configuration of ReportGenerator action after playing with Daniel Palme online tool at
    https://reportgenerator.io/usage
1. **0244188** Displaying current directory content
1. **f54999f** Added another action to upload coverage report artifact
1. **4a7911b** Setting ACTIONS_RUNNER_DEBUG variable to true
    Reference:
    - https://docs.github.com/en/actions/learn-github-actions/variables
1. **84b91cb** Setting up working-directory
1. **4f63343** Setting up working-directory
    New references:
        - https://docs.github.com/en/actions/learn-github-actions/variables
1. **23c5780** Another tentative of getting syntax for working directory correct
1. **b95b727** Another tentative of getting syntax for working directory correct - 2
1. **a87faa0** Switching directories before installing reportgenerator
1. **a6b3f47** Added action stricky-pull-request-comment
    Reference:
    - danielpalme/ReportGenerator-GitHub-Action#7
1. **ffee250** Pinned github actions workflow in VS Code
1. **a1c5bb5** Fixed action to display current directory and fixed path to report generator
1. **1e3d731** Miscellaneous changes and fix in Run tests for Palindromes action
1. **ffb9640** Still trying to get GitHub actions syntax correct
1. **5e01a44** List all files under GitHub workspace
1. **52c57a6** Fixed path for parameter CoverletOutput in actions Run tests for Palindromes and Run tests for ConsoleApp
1. **723612f** Added replicas of actions for Palindromes tests
1. **e744908** Fixed task ReportGeneratorForPalindromes - path was wrong
1. **d5ac590** Fixed task sticky-pull-request-comment - Path to reports was reportedly wrong - Maybe now it is correct
1. **9b65764** Set permissions for the job to that action that writes on PR gets enough acess
   - References:
       - https://github.com/marketplace/actions/sticky-pull-request-comment
       - https://github.com/marocchino/sticky-pull-request-comment/issues/930de
2. **20f9193** Added different headers to enable that each test project has its own summary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants