Skip to content

Commit

Permalink
pkgdepends
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoporreca committed Jan 15, 2024
1 parent 8de0066 commit 03c8012
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/ci-cd-renv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 03c8012

Please sign in to comment.