These steps are useful if your CI run needs additional packages. Usually they are declared as dependencies in your DESCRIPTION, but it is also possible to install dependencies manually. By default, binary versions of packages are installed if possible, even if the CRAN version is ahead.

A step_install_deps() step installs all package dependencies declared in DESCRIPTION, using remotes::install_deps(). This includes upgrading outdated packages.

This step can only be used if a DESCRIPTION file is present in the repository root.

A step_install_cran() step installs one package from CRAN via install.packages(), but only if it's not already installed.

A step_install_github() step installs one or more packages from GitHub via remotes::install_github(), the packages are only installed if their GitHub version is different from the locally installed version.

step_install_deps(
  repos = repo_default(),
  type = getOption("pkgType"),
  dependencies = TRUE
)

step_install_cran(
  package = NULL,
  ...,
  repos = repo_default(),
  type = getOption("pkgType")
)

step_install_github(repo = NULL, ..., type = getOption("pkgType"))

Arguments

repos

CRAN-like repositories to install from, defaults to repo_default().

type

Passed on to install.packages(). The default avoids installation from source on Windows and macOS by passing .Platform$pkgType.

dependencies

Which dependencies do you want to check? Can be a character vector (selecting from "Depends", "Imports", "LinkingTo", "Suggests", or "Enhances"), or a logical vector.

TRUE is shorthand for "Depends", "Imports", "LinkingTo" and "Suggests". NA is shorthand for "Depends", "Imports" and "LinkingTo" and is the default. FALSE is shorthand for no dependencies (i.e. just check this package, not its dependencies).

The value "soft" means the same as TRUE, "hard" means the same as NA.

You can also specify dependencies from one or more additional fields, common ones include:

  • Config/Needs/website - for dependencies used in building the pkgdown site.

  • Config/Needs/coverage for dependencies used in calculating test coverage.

package

Package(s) to install

...

Passed on to install.packages() or remotes::install_github().

repo

Package to install in the "user/repo" format.

See also

Examples

#> Creating a clean tic stage configuration
#> See `?tic::dsl_get` for details
get_stage("install") %>% add_step(step_install_deps()) dsl_get()
#>
#> ── tic configuration ───────────────────────────────────────────────────────────
#> ── install ──────────────────────────────────────────────────────────── stage ── #> ▶ step_install_deps()
#> Creating a clean tic stage configuration
#> See `?tic::dsl_get` for details
get_stage("install") %>% add_step(step_install_cran("magick")) dsl_get()
#>
#> ── tic configuration ───────────────────────────────────────────────────────────
#> ── install ──────────────────────────────────────────────────────────── stage ── #> ▶ step_install_cran("magick")
#> Creating a clean tic stage configuration
#> See `?tic::dsl_get` for details
get_stage("install") %>% add_step(step_install_github("rstudio/gt")) dsl_get()
#>
#> ── tic configuration ───────────────────────────────────────────────────────────
#> ── install ──────────────────────────────────────────────────────────── stage ── #> ▶ step_install_github("rstudio/gt")