tic.R

# installs dependencies, runs R CMD check, runs covr::codecov()
do_package_checks(args=c("--as-cran","--install-args=--build"))

InstallRemoteBinaries <- R6Class(
  "InstallRemoteBinaries",
  inherit = TicStep,

  public = list(
    run = function() {
      # get remotes and try to install binaries
      remotes = ghtravis::get_remotes()

      if(!is.null(remotes)) {
        for(remote in remotes) {
          remote_info <- ghtravis::parse_remotes(remote)
          github_user <- sapply(remote_info, `[[`, "username")
          repo <- sapply(remote_info, `[[`, "repo")
          slug <- paste0(paste0(github_user,"/",repo))

          if(!is.null(github_user) && !is.null(repo)) {
            message(paste0("Installing ",repo," binaries"))
            ghtravis::install_remote_binaries(check_r_version = TRUE, force_sha = FALSE, remotes = c(slug))
          }
        }
      }
    }
  )
)

step_install_remote_binaries <- function() {
  InstallRemoteBinaries$new()
}

get_stage("before_install") %>%
add_step(step_install_remote_binaries())
neuroconductor-devel/templateflow documentation built on March 4, 2021, 12:53 a.m.