Skip to content

Commit

Permalink
Simplify renv system dependencies based on pkgdepends as our prefer…
Browse files Browse the repository at this point in the history
…red choice
  • Loading branch information
riccardoporreca committed Jan 22, 2024
1 parent dcccc87 commit 7eb5141
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/ci-cd-renv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,15 @@ jobs:

- name: Install system dependencies
# This is not taken care of (yet) by r-lib/actions/setup-renv
# We rely on pkgdepends (from the library embedded in pak) to detect and
# install system requirements for the renv.lock packages
# We could use pak-based installation for renv, which includes system
# requirements, but would have to handle the pak cache explicitly
# See https://github.com/r-lib/actions/issues/785
run: |
# We rely on pkgdepends from the library embedded in pak
install.packages("pak", repos = "https://r-lib.github.io/p/pak/stable/")
install.packages("jsonlite")
.libPaths(c(system.file("library", package = "pak"), .libPaths()))
pkg_installation_proposal <- pkgdepends::new_pkg_installation_proposal(
pkgdepends::new_pkg_installation_proposal(
names(jsonlite::read_json("renv.lock")$Packages), config = list(dependencies = FALSE)
)$solve()
pkg_installation_proposal$show_solution()
pkg_installation_proposal$install_sysreqs()
)$solve()$install_sysreqs()
shell: Rscript {0}

- name: Activate renv and restore packages with cache
Expand Down

0 comments on commit 7eb5141

Please sign in to comment.