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

Coverage report in readme #32

Merged
merged 4 commits into from
Jun 17, 2024
Merged

Conversation

Mews
Copy link
Collaborator

@Mews Mews commented Jun 17, 2024

Closes #30

Changes
Changed the ci workflow to use the py-cov-action/python-coverage-comment-action to create a coverage badge and report to display in the readme.
To do this, I also had to add a .coveragerc file to store a configuration option for pytest-cov.

Also I took the liberty to upgrade actions/setup-python from version 3 to version 5 :)

@indrajithi
Copy link
Collaborator

I am not sure we even need setup-python since we are using poetry for packaging. You can confirm that and remove it if not require.

@indrajithi
Copy link
Collaborator

I am not sure we even need setup-python since we are using poetry for packaging. You can confirm that and remove it if not require.

Nevermind. It is in github actions. I thought we had that in as a requirement.

@Mews
Copy link
Collaborator Author

Mews commented Jun 17, 2024

I am not sure we even need setup-python since we are using poetry for packaging. You can confirm that and remove it if not require.

We do because you need to have python installed for poetry to run xd

name: Generate coverage comment
id: coverage_comment
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to create this token?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. The action will create a separate branch where it'll store the badge svg and the html report, and it needs that token to do so. Rest assured, the version for the action is set explicitly and the action is ran entirely on github, no docker containers or anything, so your token is safe :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the action runs, check the new branch and just copy the markdown code for badge from the readme :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the action runs, check the new branch and just copy the markdown code for badge from the readme :)

Is it a onetime thing or do we have to do it everytime the coverage changes?

@indrajithi indrajithi merged commit 39c69f2 into DataCrawl-AI:master Jun 17, 2024
10 checks passed
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.

Display coverage percentage in readme
2 participants