Skip to content

Commit

Permalink
wrap-up
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoporreca committed Jan 15, 2024
1 parent 863f741 commit a09a81d
Showing 1 changed file with 9 additions and 28 deletions.
37 changes: 9 additions & 28 deletions .github/workflows/ci-cd-renv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,41 +46,22 @@ jobs:
# No RStudio Package Manager to respect renv.lock
use-public-rspm: false

- name: Setup R
# 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
dependencies: NA
cache-version: 'sysreqs-1' # to exclude caches with the renv cache

- name: Install system dependencies
# This is not taken care of (yet) by r-lib/actions/setup-renv
# 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: |
print(pak::pkg_sysreqs("roxygen2"))
print(str(jsonlite::read_json("renv.lock"), max.level=2))
pkgs <- names(jsonlite::read_json("renv.lock")[["Packages"]])
print(pkgs)
pak::sysreqs_fix_installed(c("curl"))
pak::sysreqs_fix_installed(pkgs)
stop("aaa")
shell: Rscript {0}

- name: Install system dependencies
# This is not taken care of (yet) by r-lib/actions/setup-renv
# 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("jsonlite")
print(pak::pkg_sysreqs("roxygen2"))
print(str(jsonlite::read_json("renv.lock"), max.level=2))
pkgs <- names(jsonlite::read_json("renv.lock")[["Packages"]])
print(pkgs)
pak::sysreqs_fix_installed(c("curl"))
pak::sysreqs_fix_installed(pkgs)
locked_packages <- names(jsonlite::read_json("renv.lock")[["Packages"]])
pak::sysreqs_fix_installed(locked_packages)
shell: Rscript {0}

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

0 comments on commit a09a81d

Please sign in to comment.