Learn R Programming

tic (version 0.2.13.9011)

DSL: tic's domain-specific language

Description

Functions to define stages and their constitutent steps.

get_stage() returns a Stage object for a stage given by name. This function only works when called by load_from_file().

add_step() adds a step to a stage, see step_hello_world() and the links therein for available steps.

add_code_step() is a shortcut for add_step(step_run_code(...)).

do_package_checks() adds default steps related to package checks to the "before_install", "install", "script" and "after_success" stages:

  1. step_install_deps() in the "install" stage, using the repos argument.

  2. step_rcmdcheck() in the "script" stage, using the warnings_are_errors, notes_are_errors, args, and build_args arguments.

  3. A call to covr::codecov() in the "after_success" stage (only if the codecov flag is set)

do_pkgdown() builds and optionally deploys a pkgdown site and adds default steps to the "install", "before_deploy" and "deploy" stages:

  1. step_install_deps() in the "install" stage, using the repos argument.

  2. step_setup_ssh() in the "before_deploy" to setup the upcoming deployment.

  3. step_setup_push_deploy() in the "before_deploy" stage.

  4. step_build_pkgdown() in the "deploy" stage

  5. step_do_push_deploy() in the "deploy" stage. By default, the deploy is done to the gh-pages branch.

Usage

get_stage(name)

add_step(stage, step)

add_code_step(stage, call = NULL, prepare_call = NULL)

do_package_checks(..., codecov = !ci_is_interactive(), warnings_are_errors = NULL, notes_are_errors = NULL, args = c("--no-manual", "--as-cran"), build_args = "--force", error_on = "warning", repos = repo_default(), timeout = Inf)

do_pkgdown(..., build_only = FALSE, orphan = FALSE, checkout = TRUE, repos = repo_default(), path = ".", branch = NULL, remote_url = NULL, commit_message = NULL, commit_paths = ".")

Arguments

name

[string] The name for the stage.

stage

[Stage] A Stage object as returned by get_stage().

step

[function] An object of class TicStep, usually created by functions with the step_ prefix like step_hello_world().

call

[call] An arbitrary R expression executed during the stage to which this step is added. The default is useful if you only pass prepare_call.

prepare_call

[call] An optional arbitrary R expression executed during preparation.

...

Ignored, used to enforce naming of arguments.

codecov

[flag] Whether to include a step running covr::codecov(quiet = FALSE) (default: only for non-interactive CI, see ci_is_interactive()).

warnings_are_errors

[flag] Deprecated, use error_on.

notes_are_errors

[flag] Deprecated, use error_on.

args

[character] Passed to rcmdcheck::rcmdcheck(), default: c("--no-manual", "--as-cran").

build_args

[character] Passed to rcmdcheck::rcmdcheck(), default: "--force".

error_on

[character] Whether to throw an error on R CMD check failures. Note that the check is always completed (unless a timeout happens), and the error is only thrown after completion. If "never", then no errors are thrown. If "error", then only ERROR failures generate errors. If "warning", then WARNING failures generate errors as well. If "note", then any check failure generated an error.

repos

[character] Passed to rcmdcheck::rcmdcheck(), default: repo_default().

timeout

[numeric] Passed to rcmdcheck::rcmdcheck(), default: Inf.

build_only

[flag] Build the pkgdown site but do not deploy it. Removes step step_setup_ssh(), step_setup_push_deploy() and step_do_push_deploy() from macro do_pkgdown.

orphan

[flag] Create and force-push an orphan branch consisting of only one commit? This can be useful e.g. for path = "docs", branch = "gh-pages", but cannot be applied for pushing to the current branch.

checkout

[flag] Check out the current contents of the repository? Defaults to TRUE, set to FALSE if the build process relies on existing contents or if you deploy to a different branch.

path

[string] Path to the repository, default "." which means setting up the current repository.

branch

[string] Target branch, default: current branch.

remote_url

[string] The URL of the remote Git repository to push to, defaults to the current GitHub repository.

commit_message

[string] Commit message to use, defaults to a useful message linking to the CI build and avoiding recursive CI runs.

commit_paths

[character] Restrict the set of directories and/or files added to Git before deploying. Default: deploy all files.