How to add R-CMD-check state on README at Github
Asked Answered
S

2

5

I know how to do R-CMD-check in R Studio and it passed all.

However, I wish to add this R-CMD-check "passing" state in README file for the package on Github

Just looks like what the picture shown below.

I saw others' this part is just a link and when click it, this just turns to this picture.

I wish to know how can I do R-CMD-check on Github and so that I can add the "passing" state in README

enter image description here

Selenium answered 28/7, 2020 at 18:13 Comment(2)
This is not really a programming question. But one part of it (codecov) is done by connecting your github page to the website of the same name codecov (link here is describing how)Terenceterencio
Good question. Also, underrated.Tandi
F
10

If you want to get this badge automatically, open the R project with your package and run:

usethis::use_github_action_check_standard()

in the R console (or RStudio). This will add a .github/workflows/ folder with some YAML content to your package. See documentation.

When you commit and push to GitHub, the check should run automatically. If you want to insert a badge, go to "Actions" menu in the GitHub web interface, open the check results and you'll see the source code of the badge (which is in SVG format) to be inserted into your README.md file. It should be updated after each push.

For full and really simple manual with screenshots go to https://ropenscilabs.github.io/actions_sandbox/packageci.html#actions-for-continuous-integration-checks.

Ferment answered 28/7, 2020 at 18:45 Comment(2)
Hey, thank you for helping. However, this is the error I get. usethis::use_github_action_check_standard() Error in file(con, "r") : cannot open the connection In addition: Warning message: In file(con, "r") : InternetOpenUrl failed: 'The operation timed out'Selenium
@BocongZhao In that case you maybe did not have internet connection or R is blocked from donwloading data. So go to example and copy that into .github/workflows/check-standard.yaml file of your package repo, commit, push and then visit "Actions" menu etc.Ferment
D
1

usethis::use_github_action() is the superseding way.

Dogie answered 15/9, 2023 at 14:57 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.