Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent installing the package itself in setup-r-dependencies #419

Closed
riccardoporreca opened this issue Oct 28, 2021 · 5 comments
Closed
Milestone

Comments

@riccardoporreca
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When installing package dependencies, it might be desirable / convenient not to install the package itself, which is also the approach of e.g. pak::local_install_dev_deps(). Action setup-r-dependencies however does install the package.

  • A use-case we have is a package that needs to be checked (and installed) headlessly.
  • For a CI workflow running R CMD check, the installation is unneccessary and might waste some precious time (e.g. with compiled code).

Describe the solution you'd like

  • Allow not installing the package itself in setup-r-dependencies, driven e.g. by a new "parameter" under with:.
  • Consider whether not installing the package might be the sensible default behavior (given R CMD check considerations from above).

Describe alternatives you've considered
The alternative is to not use setup-r-dependencies and go for the old, lengthy approach taking explicit care of caching in the workflows, like in the pre-setup-r-dependencies examples, e.g. https://github.com/r-lib/actions/blob/a880f739a14aad0d50888cb746c1bc2db2257257/examples/check-standard.yaml

Additional context
NULL

@jimhester
Copy link
Member

I think this will be resolved eventually by r-lib/pak#319 (comment)

But possibly we could in the meantime explicitly filter local::. from the dependencies.

@riccardoporreca
Copy link
Contributor Author

Thanks for the prompt reply @jimhester!

If this is already considered the way forward for setup-r-dependencies (through the new pak functionality once available), I agree you may want to already start by explicitly filtering out local::. in the "Install dependencies" step.

@burgerga
Copy link

burgerga commented Nov 15, 2021

Another use case for this is if you setup a shiny app using shiny::shinyAppTemplate(),
and use a DESCRIPTION file to manage the package dependencies (as suggested by https://usethis.r-lib.org/reference/use_description.html).

Then https://github.com/rstudio/shiny-testing-gha-example can be greatly simplified by using setup-r-dependencies, but currently, it tries to install the shiny app as a package and this can fail (because it is not a package)

@gaborcsardi
Copy link
Member

This is now fixed in the v2 tag.

@github-actions
Copy link

github-actions bot commented Nov 6, 2022

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this issue

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants