This action checks an R package using the rcmdcheck package.
Inputs available:
- args - default
c("--no-manual", "--as-cran")
. Arguments to pass to theargs
parameter ofrcmdcheck
. It must be an R expression. Note that you often need to quote it, see details below. - build_args - default
"--no-manual"
. Arguments to pass to thebuild_args
parameter ofrcmdcheck
. It must be an R expression. Note that you often need to quote it, see details below. - check-dir - default
"check"
. Arguments to pass to thecheck-dir
parameter ofrcmdcheck
. It must be an R expression. Note that you often need to quote it, see details below. - error-on - default
"warning"
. Arguments to pass to theerror-on
parameter ofrcmdcheck
. It must be an R expression. Note that you often need to quote it, see details below. - upload-snapshots - default
false
. Whether to upload all testthat snapshots as an artifact. - upload-results - default
false
. Whether to upload check results for successful runs too. - working-directory - default
"."
. If the R package to check is not in the root directory of your repository. - artifact-name - Use this to override the default artifact name for the
check results. The default is
{os}-{arch}-r{rversion}-{id}-result
, where{id}
ismatrix.config.id
orstrategy.job-index
if the former is not defined. - snapshot-artifact-name: Use this to override the default artifact name
for testthat snapshots. The default is
{os}-{arch}-r{rversion}-{id}-testthat-snapsots
, where{id}
ismatrix.config.id
orstrategy.job-index
if the former is not defined.
Basic:
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check
- uses: r-lib/actions/check-r-package@v2
With specified inputs:
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check
- uses: r-lib/actions/check-r-package@v2
with:
args: 'c("--no-manual", "--as-cran")'
error-on: '"error"'
check-dir: '"check"'
Several input arguments 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 args
, error-on
and check-dir
right above), that will work.
The scripts and documentation in this project are released under the MIT License
Contributions are welcome!