Skip to contents

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 pak::local_install_dev_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 pak::pkg_install(), the packages are only installed if their GitHub version is different from the locally installed version.

Usage

step_install_deps(dependencies = TRUE)

step_install_cran(package = NULL, ...)

step_install_github(repo = NULL, ...)

Arguments

dependencies

What kinds of dependencies to install. Most commonly one of the following values:

  • NA: only required (hard) dependencies,

  • TRUE: required dependencies plus optional and development dependencies,

  • FALSE: do not install any dependencies. (You might end up with a non-working package, and/or the installation might fail.) See Package dependency types for other possible values and more information about package dependencies.

package

Package(s) to install

...

Passed on to pak::pkg_install().

repo

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

Examples

dsl_init()
#>  Creating a clean tic stage configuration
#>  See `?tic::dsl_get` for details

get_stage("install") %>%
  add_step(step_install_deps())

dsl_get()
#> ── tic configuration summary ───────────────────────────────────────────────────
#> ── Stage: install ──────────────────────────────────────────────────────────────
#>  step_install_deps()
dsl_init()
#>  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 summary ───────────────────────────────────────────────────
#> ── Stage: install ──────────────────────────────────────────────────────────────
#>  step_install_cran("magick")
dsl_init()
#>  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 summary ───────────────────────────────────────────────────
#> ── Stage: install ──────────────────────────────────────────────────────────────
#>  step_install_github("rstudio/gt")