我正在尝试使用 GitHub Actions对于 CI 测试,到目前为止,我的测试工作流程如下:
name: test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm install
- name: test
run: |
npm run lint
npm test
env:
CI: true
.github/workflows/test.yml
它工作正常,除了我想重试
test
如果测试失败,则单步(或整个工作)一次。基本上,您使用
travis-retry
获得的行为相同:script:
- npm run lint
- travis_retry npm test
或使用 Gitlab CI:
test:
stage: test
retry: 1
script:
- npm run lint
- npm test
不确定是否有解决此问题的方法或相当简单的解决方法
最佳答案
对于您的特定用例,只需执行以下操作:
npm test || npm test
关于continuous-integration - 在 github 操作中重试失败的作业,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59356518/