Skip to content

Adding GitHub action with code coverage#2

Merged
joshjohanning merged 6 commits intomainfrom
github-action
Sep 3, 2021
Merged

Adding GitHub action with code coverage#2
joshjohanning merged 6 commits intomainfrom
github-action

Conversation

@joshjohanning
Copy link
Copy Markdown
Owner

  • adding first github action
  • adding in code coverage
  • updating path
  • adding copy code coverage script
  • updating branch, line spaces

@github-actions
Copy link
Copy Markdown

github-actions bot commented Sep 3, 2021

Code Coverage

Package Line Rate Branch Rate Complexity
PrimeService 100% 100% 6
Summary 100% (12 / 12) 100% (6 / 6) 6

@joshjohanning joshjohanning merged commit d4a085b into main Sep 3, 2021
@joshjohanning joshjohanning deleted the github-action branch September 3, 2021 21:27
@ardalis
Copy link
Copy Markdown

ardalis commented Feb 18, 2022

Hey josh - any idea why my PR task is just being skipped entirely here?
https://github.com/ardalis/GuardClauses/runs/5249960101?check_suite_focus=true

image

    - name: Add Coverage PR Comment
      uses: marocchino/sticky-pull-request-comment@v2
      if: github.event_name == 'pull_request'
      with:
        recreate: true
        path: code-coverage-results.md

@joshjohanning
Copy link
Copy Markdown
Owner Author

Hey @ardalis ! The only time I saw my 'add coverage PR comment' action not run was when it was just in my branch run, ie:

https://github.com/joshjohanning/PrimeService-unit-testing-using-dotnet-test/runs/3510067235?check_suite_focus=true

When it was initiated as part of a Pull Request, then it ran as desired: https://github.com/joshjohanning/PrimeService-unit-testing-using-dotnet-test/runs/3510067235?check_suite_focus=true

image

Do you have the pull_request event enabled?

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

@ardalis
Copy link
Copy Markdown

ardalis commented Feb 18, 2022

Thanks, I just realized the coverage was running successfully just the add PR comment failed, and it so happened that that run was triggered by my action commit, not my PR commit. Doh! It's working now, thanks for the article and assistance!

@YazaWainakh
Copy link
Copy Markdown

YazaWainakh commented Sep 12, 2022

Hello @joshjohanning ,
any idea why the project name is not visible in the pr-omment? 😅 I am not sure where it should be read from.
For reference, I am actually running it on a Scala project.
CON-82-pull-request-tests-by-JohannesViering-·-Pull-Request-11-·-Patagona-team-constellation-onboarding

@joshjohanning
Copy link
Copy Markdown
Owner Author

@YazaWainakh good question!

For me, it's actually coming from my csproj file name. I renamed my project to PrimeService3.csproj, and it then changed in my output:

image

image

I'm not super familiar with Scala. Perhaps log a bug report in the irongut/CodeCoverageSummary repo?

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

Successfully merging this pull request may close these issues.

3 participants