github 的 actions 中运行失败,重试步骤(或整个作业)

1.Github actions 解决办法

.github / workflows / test.yml

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 || npm test || npm test

2.Github travis 解决办法

script:
  - npm run lint
  - travis_retry npm test

3.Gitlab CI 解决办法

test:
  stage: test
  retry: 1
  script:
    - npm run lint
    - npm test

Q.E.D.