You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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().
The text was updated successfully, but these errors were encountered:
jimhester
changed the title
Support GitHub Actions - exact action items inside
Automatic support for Coveralls on GItHub Actions
May 27, 2023
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.
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.
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
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 theGITHUB_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. Perhapssystem_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 justget_it_info()
.The text was updated successfully, but these errors were encountered: