Skip to content

Commit

Permalink
Use pak to ensure system requirements for all packages in renv.lock.
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoporreca committed Jan 15, 2024
1 parent 1bc7c74 commit 2c611c6
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 @@ -48,18 +48,13 @@ jobs:

- name: Install system dependencies
# This is not taken care of (yet) by r-lib/actions/setup-renv
# We need the development version of remotes to support Ubuntu 22.04 and
# for querying system requirements for multiple pkgs (r-lib/remotes#665)
# 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: |
Rscript -e "install.packages(c('remotes', 'distro', 'jsonlite'))"
Rscript -e "remotes::install_github('r-lib/remotes')"
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(with(distro::distro(), remotes::system_requirements(id, short_version, package = names(jsonlite::read_json("renv.lock")$Packages))))')
install.packages(c("pak", "jsonlite"))
pak::sysreqs_fix_installed(names(jsonlite::read_json("renv.lock")[["Packages]"])
shell: Rscript {0}

- name: Activate renv and restore packages with cache
uses: r-lib/actions/setup-renv@v2
Expand Down

0 comments on commit 2c611c6

Please sign in to comment.