February 1, 2022 From rOpenSci (https://deploy-preview-488--ropensci.netlify.app/blog/2022/02/01/pkgcheck-action/). Except where otherwise noted, content on this site is licensed under the CC-BY license.
The pkgcheck package has
been developed by rOpenSci to automate the process of checking all packages on
submission. The ropensci-review-bot
automatically runs pkgcheck on all submissions, and checks can also be called at any time by editors using the command:
@ropensci-review-bot check package
The bot will return a list of checks which should ideally look like this:
To be ready for peer review, pkgcheck should return a series of ✔, indicating successful checks, and there shouldn’t be any ✘ symbols, which indicate failed checks. Anybody preparing a package to submit is recommended to “use pkgcheck” to confirm that a package is indeed ready to submit. Until now, this has only been possible through locally installing the package and running the pkgcheck()
command. Local checks suffer two important disadvantages:
Just like the GitHub rcmdcheck action which can be easily installed with one of the use_github_action_check_...
functions from the usethis
package, pkgcheck now also has a GitHub action which overcomes both of these disadvantages through running remotely (on GitHub), and generating reproducible results.
This post is the “official” release announcement of pkgcheck-action, a GitHub action which enables checks to be run every time code is pushed to GitHub. The action was developed by one of us (Jacob), and can be found on GitHub at ropensci-review-tools/pkgcheck-action. The easiest way to use this action in your own repository is to install the pkgcheck package, and run the use_github_action_pkgcheck()
function. That will place a new file in the .github/workflows
directory of your package called “pkgcheck.yaml”, an example of which is shown on the main README of the pkgcheck-action repository. The action consists of the single job expressed in the final lines:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: ropensci-review-tools/pkgcheck-action@main
There are several parameters also described in that main README, which can either be passed as parameters to the use_github_action_pkgcheck()
function, or added to the YAML workflow file as also described in the README. Once the action has been created in your repository, it can be activated by adding it in a git commit and pushing to GitHub.
In addition to the workflow printing the full details returned by the main pkgcheck function, the output of pkgcheck can also be posted to a GitHub issue, where it will appear precisely like the example shown above. Once the workflow has finished, you’ll receive a notification, and be able to view the check results (with a summary-only
parameter determining whether only a summary of results like shown above will be posted to the issue, or whether full results will be posted which include the summary followed by quite a bit more detail). The workflow will only succeed when all pkgcheck checks have been passed.
This action makes preparing packages for submission to peer review with rOpenSci much easier, by automatically confirming whether a package the general requirements for rOpenSci submissions. You can use pkgcheck-action to confirm that a package is ready for submission by following these three easy steps:
pkgcheck::use_github_action_pkgcheck()
.You can also put a pkgcheck} badge in your README by inserting a modified version of these lines:
[![pkgcheck](https://github.com/<org>/<repo>/workflows/pkgcheck/badge.svg)](https://github.com/<org>/<repo>/actions?query=workflow%3Apkgcheck)
Once your package passes all tests, the badge will turn green and look like this:
You’ll then know that your package is good to submit!
And finally, feel free to ask any questions about using pkgcheck-action, or report any bugs, at https://github.com/ropensci-review-tools/pkgcheck-action/issues.