Skip to content

Commit

Permalink
System dependencies based on pak installed w/o `r-lib/actions/setup…
Browse files Browse the repository at this point in the history
…-r-dependencies`
  • Loading branch information
riccardoporreca committed Jan 17, 2024
1 parent 0a81c9f commit d65efe8
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/ci-cd-renv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,15 @@ jobs:
# No RStudio Package Manager to respect renv.lock
use-public-rspm: false

# System dependencies are not taken care of (yet) by r-lib/actions/setup-renv
# We rely on pak and explicitly install them 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
- name: Setup pak to install system dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: jsonlite, processx
dependencies: NA
cache-version: 'sysreqs-1' # ensure keys are not shared with the renv cache
- name: Install system dependencies
# This is not taken care of (yet) by r-lib/actions/setup-renv
# We rely on pak and explicitly install them 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: |
install.packages("pak", repos = "https://r-lib.github.io/p/pak/stable/")
install.packages(c("jsonlite", "processx"))
(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) {
Expand Down

0 comments on commit d65efe8

Please sign in to comment.