From 03c80128dbb3acac69cec6c20decdc6cce1b4bda Mon Sep 17 00:00:00 2001 From: Riccardo Porreca Date: Mon, 15 Jan 2024 18:06:16 +0100 Subject: [PATCH] pkgdepends --- .github/workflows/ci-cd-renv.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-cd-renv.yml b/.github/workflows/ci-cd-renv.yml index b4a01e4..f4146ae 100644 --- a/.github/workflows/ci-cd-renv.yml +++ b/.github/workflows/ci-cd-renv.yml @@ -55,12 +55,15 @@ jobs: - name: Install system dependencies run: | install.packages("pak", repos = "https://r-lib.github.io/p/pak/stable/") - install.packages(c("processx", "jsonlite")) - (sysreqs_cmds <- pak::pkg_sysreqs(names(jsonlite::read_json("renv.lock")$Packages), dependencies = FALSE)) - # inspired by pkgdepends:::sysreqs_install - lapply(unlist(sysreqs_cmds[c("pre_install", "install_scripts", "post_install")]), function(cmd) { - processx::run("sudo", c("sh", "-c", cmd)) - }) + install.packages("jsonlite") + .libPaths(c(system.file("library", package = "pak")), .libpaths()) + pkg_installation_proposal <- pkgdepends::new_pkg_installation_proposal( + names(jsonlite::read_json("renv.lock")$Packages), + config = list(dependencies = FALSE) + ) + pkg_installation_proposal$solve() + pkg_installation_proposal$show_solution() + pkg_installation_proposal$install_sysreqs() shell: Rscript {0} - name: Activate renv and restore packages with cache