Sets up continuous integration (CI) for an R package that is developed on GitHub using GitHub Actions. These functions

  • Add the necessary configuration files and place them in .Rbuildignore.

  • Provide the markdown to insert a badge into your README

use_github_actions()

use_github_actions_tidy()

use_github_actions_badge(name = "R-CMD-check")

use_github_action(
  name,
  url = glue("https://raw.githubusercontent.com/r-lib/actions/master/examples/{name}"),
  save_as = basename(url),
  ignore = TRUE,
  open = FALSE
)

use_github_action_check_release(
  save_as = "R-CMD-check.yaml",
  ignore = TRUE,
  open = FALSE
)

use_github_action_check_full(
  save_as = "R-CMD-check.yaml",
  ignore = TRUE,
  open = FALSE
)

use_github_action_pr_commands(
  save_as = "pr-commands.yaml",
  ignore = TRUE,
  open = FALSE
)

Arguments

name

The name to give to the GitHub Actions workflow.

url

The full URL to the GitHub Actions yaml file.

save_as

Path of file to create, relative to root of active project. Defaults to template

ignore

Should the newly created file be added to .Rbuildignore?

open

Open the newly created file for editing? Happens in RStudio, if applicable, or via utils::file.edit() otherwise.

use_github_actions()

Adds a basic R-CMD-check.yaml file to the .github/workflows directory of a package. This is a configuration file for the GitHub Actions service.

use_github_actions_tidy()

Sets up tidyverse actions that check the R versions officially supported by the tidyverse, (current release, devel and four previous versions). It also adds two commands to be used in pull requests, \document to run roxygen2::roxygenise() and update the PR, and \style to run styler::style_pkg() and update the PR.

use_github_actions_badge()

Only adds the GitHub Actions badge. Use for a project where GitHub Actions is already configured.

use_github_action()

Use a specific action, either one of the example actions from r-lib/actions/examples or a custom action given by the url parameter.

use_github_action_check_release()

This action installs the latest release R version on macOS and runs R CMD check via the rcmdcheck package.

use_github_action_check_full()

This action installs the last 5 minor R versions and runs R CMD check via the rcmdcheck package on the three major OSs (linux, macOS and Windows). This action is what the tidyverse teams uses on their repositories, but is overkill for less widely used packages, which are better off using the simpler use_github_action_check_release().

use_github_action_pr_commands()

This workflow enables the use of 2 R specific commands in pull request issue comments. \document will use roxygen2 to rebuild the documentation for the package and commit the result to the pull request. \style will use styler to restyle your package.