Mor*_*arz 16 linux r github github-actions r-usethis
我正在尝试use_github_action_check_standard()
从usethis
R 包运行命令,以在 GitHub Actions 上的每次推送中检查我的包。
该测试在 Windows 和 MacOS 上运行没有问题,但对于这两个 Linux 版本,我的工作流程代码甚至在到达包代码之前就失败了。
\n当它尝试安装系统依赖项时失败,它给了我错误##[error]Process completed with exit code 1
。
当我查看原始日志(如下)时,我注意到这一行:\n Cache not found for input keys: Linux-287c850eb370edd647ed85b6fac18cbaee02effa7d01b981304dce84a452b22c-1-, Linux--1-.
\n但是我担心我不理解该错误。另外,我不认为是这样,因为密钥已经出现在上面的组中(注意 ),##[endgroup]
但错误仅出现在下一组中(如屏幕截图所示)。
有任何想法吗?非常感谢!
\n我还在下面发布了我的整个工作流程代码。
\n2020-08-12T22:21:55.5243116Z ##[group]Run install.packages(\'remotes\')\n2020-08-12T22:21:55.5243360Z [36;1minstall.packages(\'remotes\')[0m\n2020-08-12T22:21:55.5243487Z [36;1msaveRDS(remotes::dev_package_deps(dependencies = TRUE), "../.github/depends.Rds", version = 2)[0m\n2020-08-12T22:21:55.5243834Z [36;1mwriteLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), "../.github/R-version")[0m\n2020-08-12T22:21:55.5250702Z shell: /usr/local/bin/Rscript {0}\n2020-08-12T22:21:55.5251247Z env:\n2020-08-12T22:21:55.5251370Z R_REMOTES_NO_ERRORS_FROM_WARNINGS: true\n2020-08-12T22:21:55.5251571Z RSPM: https://packagemanager.rstudio.com/cran/__linux__/focal/latest\n2020-08-12T22:21:55.5251726Z R_LIBS_USER: /home/runner/work/_temp/Library\n2020-08-12T22:21:55.5251838Z TZ: UTC\n2020-08-12T22:21:55.5251944Z NOT_CRAN: true\n2020-08-12T22:21:55.5252036Z ##[endgroup]\n2020-08-12T22:21:55.7245517Z Installing package into \xe2\x80\x98/home/runner/work/_temp/Library\xe2\x80\x99\n2020-08-12T22:21:55.7246358Z (as \xe2\x80\x98lib\xe2\x80\x99 is unspecified)\n2020-08-12T22:22:10.8252493Z trying URL \'https://packagemanager.rstudio.com/cran/__linux__/focal/latest/src/contrib/remotes_2.2.0.tar.gz\'\n2020-08-12T22:22:11.4785067Z Content type \'binary/octet-stream\' length 385906 bytes (376 KB)\n2020-08-12T22:22:11.4972702Z ==================================================\n2020-08-12T22:22:11.4973457Z downloaded 376 KB\n2020-08-12T22:22:11.4973749Z \n2020-08-12T22:22:11.7705424Z * installing *binary* package \xe2\x80\x98remotes\xe2\x80\x99 ...\n2020-08-12T22:22:11.7751638Z * DONE (remotes)\n2020-08-12T22:22:11.7952384Z \n2020-08-12T22:22:11.7953131Z The downloaded source packages are in\n2020-08-12T22:22:11.7954176Z \xe2\x80\x98/tmp/RtmpnMfdtp/downloaded_packages\xe2\x80\x99\n2020-08-12T22:22:28.2516191Z ##[group]Run actions/cache@v1\n2020-08-12T22:22:28.2516310Z with:\n2020-08-12T22:22:28.2516416Z path: /home/runner/work/_temp/Library\n2020-08-12T22:22:28.2516545Z key: Linux-287c850eb370edd647ed85b6fac18cbaee02effa7d01b981304dce84a452b22c-1-\n2020-08-12T22:22:28.2516663Z restore-keys: Linux--1-\n2020-08-12T22:22:28.2516765Z env:\n2020-08-12T22:22:28.2516865Z R_REMOTES_NO_ERRORS_FROM_WARNINGS: true\n2020-08-12T22:22:28.2517041Z RSPM: https://packagemanager.rstudio.com/cran/__linux__/focal/latest\n2020-08-12T22:22:28.2517180Z R_LIBS_USER: /home/runner/work/_temp/Library\n2020-08-12T22:22:28.2517288Z TZ: UTC\n2020-08-12T22:22:28.2517383Z NOT_CRAN: true\n2020-08-12T22:22:28.2517481Z ##[endgroup]\n2020-08-12T22:22:28.3670558Z Cache not found for input keys: Linux-287c850eb370edd647ed85b6fac18cbaee02effa7d01b981304dce84a452b22c-1-, Linux--1-.\n2020-08-12T22:22:28.3750527Z ##[group]Run while read -r cmd\n2020-08-12T22:22:28.3750930Z [36;1mwhile read -r cmd[0m\n2020-08-12T22:22:28.3751045Z [36;1mdo[0m\n2020-08-12T22:22:28.3751155Z [36;1m eval sudo $cmd[0m\n2020-08-12T22:22:28.3751285Z [36;1mdone < <(Rscript -e \'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\\n")\')[0m\n2020-08-12T22:22:28.3792540Z shell: /usr/bin/bash -e {0}\n2020-08-12T22:22:28.3792673Z env:\n2020-08-12T22:22:28.3792794Z R_REMOTES_NO_ERRORS_FROM_WARNINGS: true\n2020-08-12T22:22:28.3792990Z RSPM: https://packagemanager.rstudio.com/cran/__linux__/focal/latest\n2020-08-12T22:22:28.3793151Z R_LIBS_USER: /home/runner/work/_temp/Library\n2020-08-12T22:22:28.3793268Z TZ: UTC\n2020-08-12T22:22:28.3793377Z NOT_CRAN: true\n2020-08-12T22:22:28.3793480Z ##[endgroup]\n2020-08-12T22:22:29.0943838Z usage: sudo -h | -K | -k | -V\n2020-08-12T22:22:29.0944936Z usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]\n2020-08-12T22:22:29.0945856Z usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user]\n2020-08-12T22:22:29.0946223Z [command]\n2020-08-12T22:22:29.0947040Z usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p\n2020-08-12T22:22:29.0947710Z prompt] [-T timeout] [-u user] [VAR=value] [-i|-s] [<command>]\n2020-08-12T22:22:29.0948381Z usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p\n2020-08-12T22:22:29.0948992Z prompt] [-T timeout] [-u user] file ...\n2020-08-12T22:22:29.0956330Z ##[error]Process completed with exit code 1.\n
Run Code Online (Sandbox Code Playgroud)\n# For help debugging build failures open an issue on the RStudio community with the \'github-actions\' tag.\n# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions\non:\n push:\n branches:\n - master\n pull_request:\n branches:\n - master\n\nname: R-CMD-check\n\njobs:\n R-CMD-check:\n runs-on: ${{ matrix.config.os }}\n\n name: ${{ matrix.config.os }} (${{ matrix.config.r }})\n\n strategy:\n fail-fast: false\n matrix:\n config:\n - {os: windows-latest, r: \'release\'}\n - {os: macOS-latest, r: \'release\'}\n - {os: ubuntu-20.04, r: \'release\', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}\n - {os: ubuntu-20.04, r: \'devel\', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}\n\n env:\n R_REMOTES_NO_ERRORS_FROM_WARNINGS: true\n RSPM: ${{ matrix.config.rspm }}\n \n defaults:\n run:\n working-directory: myfunctionname\n steps:\n - uses: actions/checkout@v2\n\n - uses: r-lib/actions/setup-r@master\n with:\n r-version: ${{ matrix.config.r }}\n\n - uses: r-lib/actions/setup-pandoc@master\n\n - name: Query dependencies\n run: |\n install.packages(\'remotes\')\n saveRDS(remotes::dev_package_deps(dependencies = TRUE), "../.github/depends.Rds", version = 2)\n writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), "../.github/R-version")\n shell: Rscript {0}\n\n - name: Cache R packages\n if: runner.os != \'Windows\'\n uses: actions/cache@v1\n with:\n path: ${{ env.R_LIBS_USER }}\n key: ${{ runner.os }}-${{ hashFiles(\'.github/R-version\') }}-1-${{ hashFiles(\'../.github/depends.Rds\') }}\n restore-keys: ${{ runner.os }}-${{ hashFiles(\'../.github/R-version\') }}-1-\n\n - name: Install system dependencies\n if: runner.os == \'Linux\'\n run: |\n while read -r cmd\n do\n eval sudo $cmd\n done < <(Rscript -e \'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\\n")\')\n - name: Install dependencies\n run: |\n remotes::install_deps(dependencies = TRUE)\n remotes::install_cran("rcmdcheck")\n shell: Rscript {0}\n\n - name: Check\n env:\n _R_CHECK_CRAN_INCOMING_REMOTE_: false\n run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")\n shell: Rscript {0}\n\n - name: Upload check results\n if: failure()\n uses: actions/upload-artifact@main\n with:\n name: ${{ runner.os }}-r${{ matrix.config.r }}-results\n path: check\n
Run Code Online (Sandbox Code Playgroud)\n
Mor*_*arz 15
我最终弄清楚了,但将其留在这里,因为它可能对其他人有用!
该错误与命令中的 R 代码相关,因此如果您也遇到这种情况,请重点关注代码的 R 部分,而不是工作流程代码。
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "20.04"), sep = "\n")')
Run Code Online (Sandbox Code Playgroud)
我的包位于我的 GitHub 帐户的子目录中myfunctionname
,正如我在上面的工作目录中指定的那样:
defaults:
run:
working-directory: myfunctionname
Run Code Online (Sandbox Code Playgroud)
这意味着 R 函数remotes::system_requirements("ubuntu", "20.04")
无法在指定文件夹中找到包。一旦我简单地添加了信息:
remotes::system_requirements("ubuntu", "20.04","myfunctionname")
一切正常。
归档时间: |
|
查看次数: |
78884 次 |
最近记录: |