[英]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).在我的 R 包的存储库中,我按照usethis
包文档中显示的示例(使用usethis::use_github_actions()
命令)为R CMD check
命令设置了 GitHub Actions 工作流。
I noticed that my workflow is marked as Fail
even if only warnings and notes are found (ie no errors).我注意到我的工作流程被标记为Fail
,即使只找到警告和注释(即没有错误)。
Is there a way to mark runs without errors as a Pass
?有没有办法将没有错误的运行标记为Pass
? Like a flag in the .github/workflows/R-CMD-check.yaml
file就像.github/workflows/R-CMD-check.yaml
文件中的标志一样
The following is a part of my current .yaml
file.以下是我当前.yaml
文件的一部分。 I tried adding the R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
line but the change was uneffective.我尝试添加R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
行,但更改无效。
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:
...
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
.我意识到问题出在调用rcmdcheck()
函数的文件的实际部分中,该函数是自动创建的并使用已经实现的工作流check-r-package
。
Therefore, the problem is solved by modifying the .github/workflows/R-CMD-check.yaml
file as follows:因此,通过修改.github/workflows/R-CMD-check.yaml
文件如下解决问题:
- 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
.通过这种方式,我们可以为r-lib/actions/check-r-package@v1
内部运行的rcmdcheck::rcmdcheck(...)
命令设置参数。 Under with
, you can set the arguments of rcmdcheck(...)
as you wish, and you can modify the internal call to the function.在with
下,您可以根据需要设置rcmdcheck(...)
的参数,并且可以修改对函数的内部调用。
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.无论如何,在此链接https://github.com/r-lib/actions上,您可以找到可以在已实现的工作流中使用的参数/标志,也可以在安装依赖项 ecc 的工作流中使用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.