From 30b47fc5b48d92061b1575e51e35a5d3824eb631 Mon Sep 17 00:00:00 2001 From: Riccardo Porreca Date: Mon, 15 Jan 2024 17:35:49 +0100 Subject: [PATCH] WiP --- .github/workflows/ci-cd-renv.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd-renv.yml b/.github/workflows/ci-cd-renv.yml index bf012d2..120b841 100644 --- a/.github/workflows/ci-cd-renv.yml +++ b/.github/workflows/ci-cd-renv.yml @@ -54,12 +54,17 @@ jobs: - name: Setup pak to install system dependencies uses: r-lib/actions/setup-r-dependencies@v2 with: - packages: jsonlite + packages: jsonlite, processx dependencies: NA cache-version: 'sysreqs-1' # ensure keys are not shared with the renv cache - name: Install system dependencies - run: pak::sysreqs_fix_installed(names(jsonlite::read_json("renv.lock")$Packages)) + run: | + (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)) + }) shell: Rscript {0} - name: Activate renv and restore packages with cache