{ghactions4r}
?
This repo contains a collection of reusable workflows found helpful for R packages. In addition, {ghactions4r} contains helper functions for setting up the workflows in a separate R package GitHub repository.
{ghactions4r}
different than the usethis::use_github_actions()
workflows?
Rather than having to maintain your own GitHub actions files (as you would need to with actions set up with usethis::use_github_action()
), using a {ghactions4r}
use_*
function sets up a github actions file to directly call actions that exist and are maintained in the {ghactions4r}
repository (in the workflows folder). This means all maintenance happens within the {ghactions4r}
repository rather than in your repository!
First, install the {ghactions4r}
R package.
Using R universe:
install.packages("ghactions4r",
repos = c("https://noaa-fisheries-integrated-toolbox.r-universe.dev",
"https://cran.r-project.org"))
or remotes::install_github()
:
install.packages("remotes")
remotes::install_github("nmfs-fish-tools/ghactions4r")
use_*()
functions in the {ghactions4r}
package work like use_*()
functions in the usethis
package.
Open the cloned repository of an R package and run the function of choice. These functions set up the files needed to use the reproducible workflows in {ghactions4r}
. Below are a list of the basic functions, for complete options, see the pkgdown reference documentation.
ghactions4r::use_r_cmd_check()
covr::codecov()
:
ghactions4r::use_calc_coverage()
(a codecov.io account is also necessary to view the coverage results)
ghactions4r::rm_dollar_sign()
):
ghactions4r::use_doc_and_style_r(use_rm_dollar_sign = FALSE)
ghactions4r::use_update_pkgdown()
ghactions4r::use_build_pkgdown()
ghactions4r::use_spell_check()
Commit and push the files generated up to github, making the github actions available for the repository of the R package.
The templates these functions generate can also be viewed for reference.
Check that GitHub Actions has been given the right GITHUB_TOKEN
permissions. GitHub Actions will have read-only permissions by default, rather than read and write permissions. For many workflows in this repository, read and write permissions are necessary. To modify the permissions, follow these GitHub Documentation instructions.
If still running into failing actions, please submit an issue or email kathryn.doering@noaa.gov. Bugs are always possible, as this repository is still experimental. Reporting issues will make {ghactions4r}
better for all users!
{ghactions4r}
. How do I do this?
r-lib/actions Includes basic actions for R as well as example workflows. In fact, many of the reusable workflows in {ghactions4r}
are based on these examples. Many of these can be set up through usethis’ GitHub Actions functions.
{ghactions4r}
uses the NOAA FIT Code of Conduct.
Contributions are welcome! Contributions can be code, but are not just code, but also includes things like:
Additional details are available in the NOAA FIT Contributing Guide.
“The United States Department of Commerce (DOC) GitHub project code is provided on an”as is” basis and the user assumes responsibility for its use. DOC has relinquished control of the information and no longer has responsibility to protect the integrity, confidentiality, or availability of the information. Any claims against the Department of Commerce stemming from the use of its GitHub project will be governed by all applicable Federal law. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by the Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC bureau, shall not be used in any manner to imply endorsement of any commercial product or activity by DOC or the United States Government.”
U.S. Department of Commerce | National Oceanographic and Atmospheric Administration | NOAA Fisheries