knitr::opts_chunk$set(
  comment = "#>",
  fig.path = "man/figures",
  fig.width = 10,
  asciicast_theme = if (Sys.getenv("IN_PKGDOWN") == "true") "pkgdown" else "readme"
)
asciicast::init_knitr_engine(
  echo = TRUE,
  echo_input = FALSE,
  startup = quote({
    library(cli)
    options(cli.num_colors = cli::truecolor)
  })
)

```{asciicast asciicast-setup, include = FALSE, results = "hide"} pkgload::load_all()

emoji output is slightly incorrect currently, maybe a font issue

options(pkg.emoji = FALSE)

we do this to have a package to use in the examples

setwd("/tmp") if (!file.exists("cli")) system("git clone --depth 1 https://github.com/r-lib/cli") setwd("cli") unlink(".github/workflows/rhub.yaml")

## Installation

Install rhub from CRAN:

```r
pak::pkg_install("rhub")

Usage

Requirements

See the R Consortium runners section for using rhub if your package is not on GitHub.

Private repositories

rhub uses GitHub Actions, which is free for public repositories. For private repositories you also get some minutes for free, depending on the GitHub subscription you have. See About billing for GitHub Actions for details.

Setup

  1. Switch to the directory of your package, and call rhub::rhub_setup() to add the R-hub workflow file to your package. ```{asciicast rhub-setup} rhub::rhub_setup()
2. Run `git commit` and `git push` to push the workflow file to GitHub.

3. Run `rhub::rhub_doctor()` to check if everything is set up correctly:
```{asciicast rhub-doctor}
rhub::rhub_doctor()

Run checks

Use rhub::rhub_platforms() to get a list of supported platforms and checks: ```{asciicast rhub-platforms} rhub::rhub_platforms()

```{asciicast include = FALSE}
testthat::local_mocked_bindings(
  gh_rest_post = function(...) list(status_code = 204L),
  readline = function(prompt) {
    cat(prompt)
    Sys.sleep(1)
    cat("1, 5\n")
    "1, 5"
  }
)

Run rhub::rhub_check() to start R-hub v2 checks on GitHub Actions: {asciicast rhub-check} rhub::rhub_check()

The R Consortium runners

If you don't want to put your package on GitHub, you can still use the rhub package to run package checks on any supported platform using a shared pool of runners in the https://github.com/r-hub2 GitHub organization.

The process is similar to the first version of R-hub:

Limitations of the R Consortium runners

To avoid these limitations (except for the need for a GitHub account), put your package in a GitHub repository, and use the rhub_setup() and rhub_check() functions instead of rc_submit() and the R Consortium runners.

Code of Conduct

Please note that the rhub package is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

MIT © R Consortium



r-hub/rhub documentation built on April 25, 2024, 9:23 a.m.