我正在尝试使用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
不确定是否有一种方法或合理简单的解决方法