'R-CMD-check GitHub Actions workflow failing on warnings/notes
In the repository of my R package, I set a GitHub Actions workflow for the R CMD check
command, following the examples shown in the usethis
package documentation (with the usethis::use_github_actions()
command).
I noticed that my workflow is marked as Fail
even if only warnings and notes are found (i.e. no errors).
Is there a way to mark runs without errors as a Pass
? Like a flag in the .github/workflows/R-CMD-check.yaml
file
The following is a part of my current .yaml
file. I tried adding the R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
line but the change was uneffective.
name: R-CMD-check
jobs:
R-CMD-check:
runs-on: ubuntu-latest
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
...
Solution 1:[1]
I realized the problem was in the actual part of the file calling the rcmdcheck()
function, which is automatically created and uses an already implemented workflow, check-r-package
.
Therefore, the problem is solved by modifying the .github/workflows/R-CMD-check.yaml
file as follows:
- uses: r-lib/actions/check-r-package@v1
with:
error-on: '"error"'
In this way, we can set the arguments to the rcmdcheck::rcmdcheck(...)
command which is internally run by r-lib/actions/check-r-package@v1
. Under with
, you can set the arguments of rcmdcheck(...)
as you wish, and you can modify the internal call to the function.
Anyway, at this link https://github.com/r-lib/actions you can find the arguments/flags you can use in the workflows already implemented, also in the workflows to install the dependencies ecc.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |