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 codecov token in test coverage #823

Merged

Conversation

ALanguillaume
Copy link
Contributor

Related to #822

  • To be able to upload the code coverage result to codecov.io users must now provide a CODECOV_TOKEN to authenticate to the service. This token must be defined as a repository secret.

  • GITHUB_PAT is no longer required for the workflow to work

  • Explicitly pass CODECOV_TOKEN as covr::codecov() parameter to highlight its purpose

- To be able to upload the code coverage result to codecov.io users must now provide a CODECOV_TOKEN to authenticate to the service.
- This token must be defined as a repository secret.
- GITHUB_PAT is no longer required for the workflow to work
- Make the intent of the token explicit.
- That way readers can clearly see that CODECOV_TOKEN in a requirement for `covr::codecov()`.
Copy link
Member

@gaborcsardi gaborcsardi left a comment

Choose a reason for hiding this comment

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

Thanks! Requested some changes.

examples/test-coverage.yaml Show resolved Hide resolved
examples/test-coverage.yaml Outdated Show resolved Hide resolved
Some packages need that to install dependencies from github for example
@gaborcsardi
Copy link
Member

Thanks! The thing is, if we want to keep the current behavior when the secret is not available, then we'll need to do a bit more work. :( It is not (easily) possible to conditionally set an env var in a GHA workflow, so we'll do this from the R code. I don't love this, but I think we need this to keep current repos working.

In any case I can do that later, after this is merged.

@gaborcsardi gaborcsardi merged commit a6aeac2 into r-lib:v2-branch Apr 11, 2024
27 checks passed
Copy link

This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants