This action installs dependencies for the current R environment based on the renv lockfile in the repository by:
- Installing renv
- Setting up a dependency cache using actions/cache.
Inputs available
profile
- defaultNULL
. The renv profile that should be activated. Forwarded torenv::activate()
. It must be an R expression. Note that you often need to quote it, see details below.cache-version
- default1
. If you need to invalidate the existing cache pass any other number and a new cache will be used.bypass-cache
- defaultfalse
. Whether attempts to cache should be completely skipped (for non GitHub testing). Set totrue
to skip. If"never"
is provided, the package cache will be saved even if the workflow fails. (For historical reasons the"always"
value is equivalent to"never"
.)working-directory
- default'.'
. If therenv.lock
file is not in the root directory of your repository.
Example:
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-renv@v2
with:
profile: '"shiny"'
The profile
input parameter must be specified as an R expression.
This increases flexibility, but it also causes some inconvenience, since
these expressions often need to be quoted in the YAML file.
A handy tip is that if your R expression does not contain a single quote,
and you specify it in the YAML in a single line, surrounded by single
quotes (like in the example above for profile
), that will work.
The scripts and documentation in this project are released under the MIT License
Contributions are welcome!