Skip to content
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

Add code coverage check in each pr #88

Merged
merged 4 commits into from
Jul 6, 2023
Merged

Conversation

muraca
Copy link
Contributor

@muraca muraca commented Jul 5, 2023

fix #86

@muraca muraca changed the title make clippy happy Add code coverage check in each pr Jul 5, 2023
Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
@pepoviola
Copy link
Collaborator

Hi @muraca, Thanks for working on this 👍. I think something like this will work.

    - name: Setup LCOV
      uses: hrishikesh-kadam/setup-lcov@v1
    - name: Report code coverage
      uses: zgosalvez/github-actions-report-lcov@v3
      with:
        coverage-files: lcov.*.info
        artifact-name: code-coverage-report
        github-token: ${{ secrets.GITHUB_TOKEN }}
        update-comment: true

Thanks!

@muraca
Copy link
Contributor Author

muraca commented Jul 5, 2023

@pepoviola you noticed too fast, sorry if I'm making a mess but I noticed too late that I opened a PR on this repo instead of my personal one.

I didn't want to add more bloat by installing lcov too, it is used to create an html file we don't need here, and that's why I moved from zgosalvez/github-actions-report-lcov@v3 to Nef10/lcov-reporter-action@v0.4.0.

Now I get a 404 error because the action makes a GET request to $CORRECT_URL/ and it should be without the /.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@pepoviola
Copy link
Collaborator

Hi @muraca, I fixed the request (the issue was related on how to get the pr number). But now is throwing a diff error because can't create a comment with the info.

status: 403,
  response: {
    url: 'https://api.github.com/repos/paritytech/zombienet-sdk/issues/88/comments',
    status: 403,

@muraca
Copy link
Contributor Author

muraca commented Jul 6, 2023

Looks like some permissions are missing.
Anyway I will move the coverage part to a new job, which runs only after build jobs are completed and only if it is a pull request.

Signed-off-by: muraca <mmuraca247@gmail.com>
@muraca
Copy link
Contributor Author

muraca commented Jul 6, 2023

CI run for dummy pull request.

Comment works:
image

@muraca muraca requested a review from pepoviola July 6, 2023 08:55
@pepoviola
Copy link
Collaborator

Hi @muraca, great! Yes, I wonder if the permission issue is related to be a fork. I would merge this one and we can check with the prs in this repo. Thanks again!!

@pepoviola pepoviola merged commit 438d012 into paritytech:main Jul 6, 2023
2 of 3 checks passed
@muraca muraca deleted the test branch July 6, 2023 10:52
@pepoviola
Copy link
Collaborator

Hi @muraca, just to followup this works with prs from the repo (#89). Thanks!!!

@muraca
Copy link
Contributor Author

muraca commented Jul 6, 2023

Happy to help!

@l0r1s
Copy link
Contributor

l0r1s commented Jul 6, 2023

Thanks @muraca ! 🚀

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.

[infra] Add code coverage check in each pr
4 participants