如何在GitHub Action中的GitHub回购中运行单独的脚本
尝试在GitHub操作上实现工作流,该操作将运行带有我的软件包功能的测试脚本,并理想地打印/导出结果。我是YAML语法的新手,并感谢任何帮助。
这是我当前拥有的工作流程:
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
name: Test-Script
jobs:
build:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}
- uses: r-lib/actions/setup-pandoc@v1
- name: Test against test script
run: |
/R/test_script.R #file path in repo
shell: Rscript {0}
我得到erorr:错误:错误:意外的'/'在“/”中。我尝试了多次调整,但总是会遇到错误或其他说明该文件找不到的。我也想打印出来/出口结果,但我不知道该怎么做。
感谢任何帮助。谢谢。
trying to implement a workflow on Github actions that will run a test script with the functions of my package and ideally print/export out the results. I am new to the YAML syntax and would appreciate any help.
This is the workflow I currently have:
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
name: Test-Script
jobs:
build:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}
- uses: r-lib/actions/setup-pandoc@v1
- name: Test against test script
run: |
/R/test_script.R #file path in repo
shell: Rscript {0}
I get the erorr: Error: Error: unexpected '/' in "/". I have tried multiple adjustments but always get that error or another saying that the file cannot be found. I would also like to print out/export out the results but I do not know how to do so.
Would appreciate any help please. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论