eclipse-uprotocol / up-python

uProtocol Language Specific Library for Python
Apache License 2.0
1 stars 8 forks source link

Add workflow to test code coverage and generate coverage report #24

Closed neelam-kushwah closed 3 months ago

neelam-kushwah commented 3 months ago

This PR addresses #4 , #23 which is to add a GitHub Actions workflow (coverage.yml) . The workflow runs on pull requests targeting the main branch and consists of a job named test-and-coverage. The job runs tests with coverage enabled, generates an HTML coverage report, and uploads the report as an artifact. Additionally, the workflow comments on the pull request with the coverage results.

neelam-kushwah commented 3 months ago
Screenshot 2024-04-06 163157

@stevenhartley
In my repo, the workflow can comment on PRs with code coverage details, but it's not working here, possibly due to permission issues. I've temporarily removed the comment step, but it'd be great to fix this.

neelam-kushwah commented 3 months ago

Commenting on PR is a known issue and limitation of GitHub actions when running for pull requests coming from a fork, see https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/4527#note_2084764 There are workarounds for that, but they also have security implications as pull requests from forks potentially contain malicious code. Hence removed the comment on PR step from workflow.

stevenhartley commented 3 months ago

Per offline discussion, the open issue with adding notes to the PR will be addressed in a subsequent issue