Skip to content

Refactor: Use packrat::restore() for R dependencies in CI#6

Merged
pplupo merged 1 commit into
masterfrom
update-r-version-4.5.0
Jun 11, 2025
Merged

Refactor: Use packrat::restore() for R dependencies in CI#6
pplupo merged 1 commit into
masterfrom
update-r-version-4.5.0

Conversation

@pplupo
Copy link
Copy Markdown
Owner

@pplupo pplupo commented Jun 11, 2025

This commit refactors the GitHub Actions workflow to use packrat::restore() for installing R package dependencies, providing a more robust and consistent dependency management approach aligned with the project's use of Packrat.

Changes in .github/workflows/R-CMD-check.yml:

  • The r-lib/actions/setup-r-dependencies step is now configured to primarily install packrat itself and handle system-level dependencies.
  • A new step Restore R package dependencies (packrat) has been added which executes Rscript -e "packrat::restore()". This command uses the project's packrat.lock file to install the correct versions of R package dependencies.

This approach aims to resolve previous issues where pak (used by setup-r-dependencies) had difficulty locating CRAN packages. Using packrat::restore() directly leverages the project's existing dependency management setup.

This commit refactors the GitHub Actions workflow to use `packrat::restore()`
for installing R package dependencies, providing a more robust and
consistent dependency management approach aligned with the project's
use of Packrat.

Changes in `.github/workflows/R-CMD-check.yml`:
- The `r-lib/actions/setup-r-dependencies` step is now configured to
  primarily install `packrat` itself and handle system-level dependencies.
- A new step `Restore R package dependencies (packrat)` has been added
  which executes `Rscript -e "packrat::restore()"`. This command uses the
  project's `packrat.lock` file to install the correct versions of R package
  dependencies.

This approach aims to resolve previous issues where `pak` (used by
`setup-r-dependencies`) had difficulty locating CRAN packages.
Using `packrat::restore()` directly leverages the project's existing
dependency management setup.
@pplupo pplupo merged commit 400209d into master Jun 11, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant