[CI] Revise R tests. (#8430)
- Use the standard package check (check on the tarball instead of the source tree). - Run commands in parallel. - Cleanup dependencies installation. - Replace makefile. - Documentation. - Test using the image from rhub.
This commit is contained in:
50
R-package/tests/helper_scripts/install_deps.R
Normal file
50
R-package/tests/helper_scripts/install_deps.R
Normal file
@@ -0,0 +1,50 @@
|
||||
## Install dependencies of R package for testing. The list might not be
|
||||
## up-to-date, check DESCRIPTION for the latest list and update this one if
|
||||
## inconsistent is found.
|
||||
pkgs <- c(
|
||||
## CI
|
||||
"devtools",
|
||||
"XML",
|
||||
"cplm",
|
||||
"e1071",
|
||||
## suggests
|
||||
"knitr",
|
||||
"rmarkdown",
|
||||
"ggplot2",
|
||||
"DiagrammeR",
|
||||
"Ckmeans.1d.dp",
|
||||
"vcd",
|
||||
"testthat",
|
||||
"lintr",
|
||||
"igraph",
|
||||
"float",
|
||||
"crayon",
|
||||
"titanic",
|
||||
## imports
|
||||
"Matrix",
|
||||
"methods",
|
||||
"data.table",
|
||||
"jsonlite"
|
||||
)
|
||||
|
||||
ncpus <- parallel::detectCores()
|
||||
print(paste0("Using ", ncpus, " cores to install dependencies."))
|
||||
|
||||
if (.Platform$OS.type == "unix") {
|
||||
print("Installing source packages on unix.")
|
||||
install.packages(
|
||||
pkgs,
|
||||
repo = "https://cloud.r-project.org",
|
||||
dependencies = c("Depends", "Imports", "LinkingTo"),
|
||||
Ncpus = parallel::detectCores()
|
||||
)
|
||||
} else {
|
||||
print("Installing binary packages on Windows.")
|
||||
install.packages(
|
||||
pkgs,
|
||||
repo = "https://cloud.r-project.org",
|
||||
dependencies = c("Depends", "Imports", "LinkingTo"),
|
||||
Ncpus = parallel::detectCores(),
|
||||
type = "binary"
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user