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

Automatic support for Coveralls on GItHub Actions #535

Open
daattali opened this issue May 26, 2023 · 2 comments
Open

Automatic support for Coveralls on GItHub Actions #535

daattali opened this issue May 26, 2023 · 2 comments

Comments

@daattali
Copy link
Contributor

daattali commented May 26, 2023

This is a continuation of #457 with more clear objectives, now that we're debugged and understood exactly where the issues lie.

There is currently code (

covr/R/coveralls.R

Lines 65 to 70 in caed186

git_info <- switch(service_name,
drone = jenkins_git_info(), # drone has the same env vars as jenkins
jenkins = jenkins_git_info(),
'travis-pro' = jenkins_git_info(),
list(NULL)
)
) that only adds git info to the coverage report if the CI is one of: [jenkins, drone, travis-pro]. This list needs to be also include "github-actions" (and the documentation should explicitly say that this string is supported).

This will get {covr} to attempt to attach git info, but it will not fully work yet. Specifically, the badge will not get updated because the branch will not be set correctly. This is because in https://github.com/r-lib/covr/blob/caed186fc47884d1e848c09ddb9433716bd671c6/R/coveralls.R#LL117C35-L117C58 it's looking for the envvar CI_BRANCH which does not exist in GitHub Actions. Perhaps using the GITHUB_REF_NAME envvar will work (I haven't tested it, but based on github actions' documentation it seems like it should).

Other than the branch not getting set correctly, the remote URL is also not set because it looks for a CI_REMOTE envvar, which again doesn't exist for github actions. Perhaps system_output("git", c("config", "--get", "remote.origin.url")) can be used for that.

And lastly, for code cleanliness purposes, it might be a good idea to rename the function jenkins_git_info() to just get_it_info().

@jimhester jimhester changed the title Support GitHub Actions - exact action items inside Automatic support for Coveralls on GItHub Actions May 27, 2023
@jimhester
Copy link
Member

For at least the last 8 years codecov has been the recommended provider to use with covr rather than coveralls, and today very few people still use coveralls.

Because of this is unlikely any time will be spent on this issue. If you want this automatic support for coveralls you are going to need to send a PR with the suggested changes in this issue. As they seem minor it will likely be merged after a review round.

@daattali
Copy link
Contributor Author

daattali commented Jun 1, 2023

Unfortunately I'm using it within an organization that has approved coveralls but has not approved codecov (🤷‍♂️ ). I may open a PR in the future for this.

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

No branches or pull requests

2 participants