Refactor: Use packrat::restore() for R dependencies in CI#6
Merged
Conversation
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:r-lib/actions/setup-r-dependenciesstep is now configured to primarily installpackratitself and handle system-level dependencies.Restore R package dependencies (packrat)has been added which executesRscript -e "packrat::restore()". This command uses the project'spackrat.lockfile to install the correct versions of R package dependencies.This approach aims to resolve previous issues where
pak(used bysetup-r-dependencies) had difficulty locating CRAN packages. Usingpackrat::restore()directly leverages the project's existing dependency management setup.