Ivo*_*hev 10 github github-actions building-github-actions
官方 github actions 文档说我可以设置defaults来指定所有作业的默认设置(https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#defaults)。我想设置它来指定
defaults:
runs-on: ubuntu-latest
strategy:
fail-fast: false # do not cancel 7.2 if 7.3 fails
matrix:
php: ['7.2', '7.3', '7.4']
node-version: ['12.5']
jobs:
...
Run Code Online (Sandbox Code Playgroud)
但这失败了
The workflow is not valid. .github/workflows/code_checks.yaml (Line: 7, Col: 3): Unexpected value 'runs-on',.github/workflows/code_checks.yaml (Line: 8, Col: 3): Unexpected value 'strategy'
Run Code Online (Sandbox Code Playgroud)
我想为我的所有工作指定相同的runs-on内容。strategy为什么不defaults工作?
这是不可能的,defaults您只能设置shell和working-directory。
您正在寻找不存在的默认策略。使用 Github Actions 需要记住的一件事是,每个作业都生成在不同的机器上,该机器不与前一个作业共享任何信息。
更符合你需求的,是一套策略、多个步骤,创造一份工作。
| 归档时间: |
|
| 查看次数: |
6086 次 |
| 最近记录: |