Title: | Tools for R Package Developers |
---|---|
Description: | R-hub v2 uses GitHub Actions to run 'R CMD check' and similar package checks. The 'rhub' package helps you set up R-hub v2 for your R package, and start running checks. |
Authors: | Gábor Csárdi [aut, cre], Maëlle Salmon [aut] , R Consortium [fnd] |
Maintainer: | Gábor Csárdi <[email protected]> |
License: | MIT + file LICENSE |
Version: | 2.0.0.9000 |
Built: | 2024-11-01 04:40:05 UTC |
Source: | https://github.com/r-hub/rhub |
This function is deprecated and defunct. Please see rhubv2.
check(...)
check(...)
... |
Deprecated. |
This function is deprecated and defunct. Please see rhubv2.
check_for_cran(...)
check_for_cran(...)
... |
Deprecated. |
This function is deprecated and defunct. Please see rhubv2.
check_on_linux(...) check_on_windows(...) check_on_macos(...) check_on_debian(...) check_on_ubuntu(...) check_on_fedora(...) check_on_solaris(...) check_on_centos(...) check_with_roldrel(...) check_with_rrelease(...) check_with_rpatched(...) check_with_rdevel(...) check_with_valgrind(...) check_with_sanitizers(...)
check_on_linux(...) check_on_windows(...) check_on_macos(...) check_on_debian(...) check_on_ubuntu(...) check_on_fedora(...) check_on_solaris(...) check_on_centos(...) check_with_roldrel(...) check_with_rrelease(...) check_with_rpatched(...) check_with_rdevel(...) check_with_valgrind(...) check_with_sanitizers(...)
... |
Deprecated. |
This function is deprecated and defunct. Please see rhubv2.
get_check(...)
get_check(...)
... |
Deprecated. |
This function is deprecated and defunct. Please see rhubv2.
last_check(...)
last_check(...)
... |
Deprecated. |
This function is deprecated and defunct. Please see rhubv2.
list_my_checks(...)
list_my_checks(...)
... |
Deprecated. |
This function is deprecated and defunct. Please see rhubv2.
list_package_checks(...)
list_package_checks(...)
... |
Deprecated. |
This function is deprecated and defunct. Please see rhubv2.
list_validated_emails(...)
list_validated_emails(...)
... |
Deprecated. |
This function is deprecated and defunct. Please see rhubv2.
local_check_linux(...)
local_check_linux(...)
... |
Deprecated. |
This function is deprecated and defunct. Please see rhubv2.
local_check_linux_images(...)
local_check_linux_images(...)
... |
Deprecated. |
This function is deprecated and defunct. Please see rhubv2.
platforms(...)
platforms(...)
... |
Deprecated. |
Lists all tokens stored on the local machine.
rc_list_local_tokens()
rc_list_local_tokens()
Data frame with string columns email
and token
.
Other RC runners API:
rc_list_repos()
,
rc_new_token()
,
rc_submit()
Lists repositories created by rc_submit()
submissions.
rc_list_repos(email = NULL)
rc_list_repos(email = NULL)
email |
Email address. We try to detect this, but if the detection fails, you can specify it explicitly. |
Data frame with columns:
repo_name
: Name of the repository.
repo_url
: URL of the repository.
builds_url
: URL to the builds of the repository.
Additional columns and customized printing will be probably added later to the result.
Other RC runners API:
rc_list_local_tokens()
,
rc_new_token()
,
rc_submit()
To build and check R packages on the RC runners of R-hub, you'll need to verify your email address. R-hub will send a token to your email address, and this token will be stored on your computer.
rc_new_token(email = NULL, token = NULL)
rc_new_token(email = NULL, token = NULL)
email |
Email address to verify We try to detect this, but
if the detection fails, you can specify it explicitly.
If this argument is missing (or |
token |
Token to add. If you already received a token in an email from R-hub, you can specify that here. |
You need to store a token on every computer you want to submit jobs from, either using the same token from the email you got, or you can request additional tokens for the new machines. Your old token will stay valid as well.
If you already have a token from a previous version of R-hub, you can reuse that and you don't need to do anything.
Run
rhub:::email_file()
to see the file rhub uses to store your tokens.
Other RC runners API:
rc_list_local_tokens()
,
rc_list_repos()
,
rc_submit()
Submit a package to the R Consortium runners
rc_submit(path = ".", platforms = NULL, email = NULL, confirmation = NULL)
rc_submit(path = ".", platforms = NULL, email = NULL, confirmation = NULL)
path |
Path to package file or package directory. |
platforms |
Platforms to checks. See |
email |
Email address. You must have a token on the local machhine,
that corresponds to the email address, see |
confirmation |
You must set this to |
A list with data about the submission, invisibly. Currently it has:
result
: Should be the string "OK"
.
repo_url
: URL to the repository.
actions_url
: URL to the builds inside the repository.
id
: Build id. This is a string with a randomly generated id.
name
: Build name, this is a string, the concatenation of the
build platforms.
More fields might be added later.
rhub_platforms()
for a list of supported platforms.
Other RC runners API:
rc_list_local_tokens()
,
rc_list_repos()
,
rc_new_token()
Check a package on R-hub
rhub_check(gh_url = NULL, platforms = NULL, r_versions = NULL, branch = NULL)
rhub_check(gh_url = NULL, platforms = NULL, r_versions = NULL, branch = NULL)
gh_url |
GitHub URL of a package to check, or |
platforms |
Platforms to use, a character vector. Use |
r_versions |
Which R version(s) to use for the platforms that supports multiple R versions. This arguemnt is not implemented yet. |
branch |
Branch to use to run R-hub. Defaults to the current
branch if |
TODO
Errors if the package or repository is not set up correctly, and advises on possible solutions.
rhub_doctor(gh_url = NULL)
rhub_doctor(gh_url = NULL)
gh_url |
Use |
List R-hub platforms
rhub_platforms()
rhub_platforms()
Data frame with columns:
name
: platform name. Use this in the platforms
argument of
rhub_check()
.
aliases
: alternative platform names. They can also be used in the
platforms
argument of rhub_check()
.
type
: "os"
or "container"
.
os_type
: Linux, macOS or Windows currently.
container
: URL of the container image for container platforms.
github_os
: name of the OS on GitHub Actions for non-container
platforms.
r_version
: R version string. If "*"
then any supported R version
can be selected for this platform.
os_name
: name of the operating system, including Linux distribution
name and version for container actions.
It adds or updates the R-hub workflow file to the current package, and advises on next steps.
rhub_setup(overwrite = FALSE)
rhub_setup(overwrite = FALSE)
overwrite |
if |
Nothing.
Start here to learn about R-hub v2, especially if you used the previous version of R-hub before.
R-hub v2, i.e. version 2 or later of the rhub package is a completely new check system. In this acticle we highlight the differences between the old and the new system.
There are two ways to use R-hub v2. The recommended way is to store your
R package in a GitHub repository and use the rhub_*()
functions to
start checks on GitHub Actions, using your own GitHub account.
Alternatively, if you don't want to store your R package at GitHub, you
can use the rc_*()
functions to run checks in a shared GitHub
organization at https://github.com/r-hub2, using the R Consortium runners.
See more about the R Consortium runners below.
First, you need a GitHub account.
Second, you need to have your R package in a GitHub repository.
In your local git clone make sure that the origin
git remote is set
to the GitHub repository.
Third, you need a GitHub Personal Access Token
and you need to store it in the git credential store on your machine.
You can use gitcreds::gitcreds_set()
to add the token to the git
credential store.
Call rhub_setup()
from the local git clone to set up R-hub v2 for your
package. This adds a GitHub Actions workflow to your local repository.
Push this change to GitHub, into your default git branch and then you
are ready to call start checks with rhub_check()
.
The check picks up the package from GitHub, so it does not use
changes in your local git clone. You need to push the changes to
GitHub first. You can use a non-default branch, with the branch
argument of rhub_check()
.
You'll not get an email about the check results. But you'll receive regular GitHub notifications about check failures, unless you opt out. Github can also turn these into emails if you like.
There is no live output from the check at the R console. See the 'Actions' tab of your repository on GitHub for a live check log.
Many more specialized platforms are available.
Most platforms use binary packages, so checks and in particular installing dependencies is much faster.
GitHub Actions 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.
You can run checks on any branch that you push to GitHub, but you'll need
to add the R-hub workflow file (.github/workflows/rhub.yaml
within
your repo) must be present in both the default branch (usually main
)
and also in the branch you want to run the check on.
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:
Set your working directory to the R package you want to check.
Obtain a token from R-hub, to verify your email address:
rc_new_token()
(You do not need to do this, if you already submitted packages to a
previous version of R-hub from the same machine, using the same email
address. Call rc_list_local_tokens()
to check if you already have
tokens.)
Submit a build with
rc_submit()
Select the platforms you want to use, and follow the instructions and the link provided to see your check results.
You package will be public for the world, and will be stored in the
https://github.com/r-hub2 organization. Your check output and results
will be public for anyone with a GitHub account. If you want to keep
your package private, you can put it in a private GitHub repository,
and use the rhub_setup()
and rhub_check()
functions instead.
The R Consortium runners are shared among all users, so you might need to wait for your builds to start.
You have to wait at least five minutes between submissions with
rc_submit()
.
Currently you need to create a GitHub account to see the check logs of your package. You don't need a GitHub account to submit the checks.
To avoid these limitations (except for the neeed for a GitHub accounr),
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.
This function is deprecated and defunct. Please see rhubv2.
validate_email(...)
validate_email(...)
... |
Deprecated. |