Repository navigation
feat(ci): install R dependencies from renv.lock via setup-renv - #321
Conversation
Switch all three render workflows (quarto-publish, quarto-publish-update- cache, ci-benchmark) from setup-r-dependencies to r-lib/actions/setup-renv (issue #306, B1 stage 2): - setup-renv restores the renv.lock-pinned library with its package cache keyed on the lockfile hash: an unchanged lockfile restores in minutes instead of ~26 min of pak resolution + install; a changed lockfile only pays the delta via restore-keys. - Drop the "Drop cached babelquarto" workaround: a repinned GitHub package changes the lockfile hash, so renv::restore() reinstalls it naturally. - Replace PKG_SYSREQS=true with explicit apt packages (libudunits2-dev, libglpk-dev added) plus a pak::pkg_sysreqs() step that runs the returned install scripts, covering the full dependency closure. - Delta-install QMD-scan-added packages after update-dependencies.R: the scan can append imports newer than renv.lock, so probe loadability and pak-install anything missing before rendering. - Disable renv's install sandbox on ephemeral runners (same as generate-renv-lock.yml). Co-Authored-By: Claude Code <noreply@anthropic.com>
✅ QMD Format CheckNo new QMD tutorial files to check.
|
PR #321's first run failed inside renv::restore(): rsvg load-tested at install time with 'librsvg-2.so.2: cannot open shared object file' — the pak pkg_sysreqs() step ran after setup-renv, so the system library arrived too late (and pak itself was not installed before restore). Move the sysreqs step before setup-renv (bootstrapping pak from PPM as a fast binary), and add librsvg2-dev to the explicit apt list as defense-in-depth. Co-Authored-By: Claude Code <noreply@anthropic.com>
✅ QMD Format CheckNo new QMD tutorial files to check.
|
|
Fixed the first-run failure (run 38069996992): Re-run 38070651651 is green end-to-end: sysreqs 2m13s → restore 13m12s (first run for this lockfile hash, builds the cache) → delta 47s → full site render success. Subsequent runs on an unchanged lockfile should restore in minutes. 🤖 Generated with Claude Code |
B1 stage 2 — render workflows switch to renv.lock installs
Part of the CI acceleration tracked in #306 (stage 1: #320 added
renv.lock; this PR wires the render workflows to it).What changes
All three render workflows (
quarto-publish.yml,quarto-publish-update-cache.yml,ci-benchmark.yml) switch fromr-lib/actions/setup-r-dependencies@v2tor-lib/actions/setup-renv@v2:renv.lockhash — an unchanged lockfile restores the whole ~650-package library in minutes instead of ~26 min of pak resolution + install (measured baseline:r_deps= 162 s on the warm path, but full cold installs hit 26 min; restore-hit path is the big win).renv::restore()reinstalls it. This removes the "Drop cached babelquarto" workaround from all three workflows.PKG_SYSREQS: "true"job is replaced by explicit apt packages (libudunits2-dev,libglpk-devadded to the existinglibcurl4-openssl-devline) plus apak::pkg_sysreqs("deps::.")step that executes the returned install scripts for the full dependency closure.update-dependencies.Rappends QMD-discovered install-call packages toDESCRIPTION, a delta step probes loadability and pak-installs anything the lockfile restore missed (no-op on a typical run).generate-renv-lock.yml.Verification plan
pull_requestrender run goes greenci-benchmark.ymldispatched after merge;r_depsphase drops toward restore-hit times🤖 Generated with Claude Code