简体   繁体   English

R-CMD-check GitHub Actions 工作流程在警告/注释上失败

[英]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.

相关问题 Github Actions - R 包 R-CMD-Check "PhantomJS not found" - Github Actions - R package R-CMD-Check "PhantomJS not found" Github 操作失败:为 R-CMD-Check 安装系统依赖项时,进程完成,退出代码为 1 - Github Action failing: Process completed with exit code 1 when installing system dependencies for R-CMD-Check 如何在 Github 的 README 中添加 R-CMD-check state - How to add R-CMD-check state on README at Github Github 上的 R-CMD-check 失败,存在“配置”但不可执行——请参阅“R 安装和管理手册” - R-CMD-check on Github fails with 'configure' exists but is not executable -- see the 'R Installation and Administration Manual' 通过 R-CMD-check 在 R Mac OS 中安装 rgl package - Installing rgl package in R Mac OS via R-CMD-check Github 操作失败,R CMD 检查,使用旧提交? - Github Action failing with R CMD check, using old commit? R CMD检查关于ggplot,子集等的注释 - R CMD check NOTEs on ggplot, subset, etc 使用R CMD检查删除软件包相关性的警告 - Remove warnings of package dependency with R CMD check R ShinyTest GitHub Actions 在 Windows 上失败,但在 Mac 和 Ubuntu 上通过 - R ShinyTest GitHub Actions failing on Windows but passing on Mac and Ubuntu R CMD CHECK --as-cran 在 OS X Catalina 上失败 - R CMD CHECK --as-cran failing on OS X Catalina
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM