From 83510e4a19085e2c2fb8edb3694011df01823a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Bou=C3=A7as?= Date: Tue, 10 Jan 2023 17:39:01 +0000 Subject: [PATCH] chore: add retry to CI workflows (#5335) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .github/workflows/integration-tests.yml | 7 ++++++- .github/workflows/legacy-tests.yml | 7 ++++++- .github/workflows/unit-tests.yml | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index d7dea14bddb..c7a11e2dfc1 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -75,8 +75,13 @@ jobs: run: npm run test:init if: '${{ !steps.release-check.outputs.IS_RELEASE }}' - name: Tests + uses: nick-fields/retry@v2 if: '${{ !steps.release-check.outputs.IS_RELEASE }}' - run: npm run test:ci:vitest:integration -- --shard=${{ matrix.shard }} ${{ steps.changed.outputs.value }} + with: + timeout_minutes: 15 + max_attempts: 3 + retry_on: error + command: npm run test:ci:vitest:integration -- --shard=${{ matrix.shard }} ${{ steps.changed.outputs.value }} env: # GitHub secrets are not available when running on PR from forks # We set a flag so we can skip tests that access Netlify API diff --git a/.github/workflows/legacy-tests.yml b/.github/workflows/legacy-tests.yml index 67087a68177..5a30777129b 100644 --- a/.github/workflows/legacy-tests.yml +++ b/.github/workflows/legacy-tests.yml @@ -75,7 +75,12 @@ jobs: run: npm run test:init if: '${{ !steps.release-check.outputs.IS_RELEASE }}' - name: Tests - run: ${{ steps.testCommand.outputs.value }} + uses: nick-fields/retry@v2 + with: + timeout_minutes: 15 + max_attempts: 3 + retry_on: error + command: ${{ steps.testCommand.outputs.value }} env: # GitHub secrets are not available when running on PR from forks # We set a flag so we can skip tests that access Netlify API diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index fbc5f0ac8c8..aa4c3dfcc9c 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -44,5 +44,10 @@ jobs: run: npm run format:ci if: '${{!steps.release-check.outputs.IS_RELEASE}}' - name: Run unit tests - run: npm run test:ci:vitest:unit + uses: nick-fields/retry@v2 + with: + timeout_minutes: 15 + max_attempts: 3 + retry_on: error + command: npm run test:ci:vitest:unit if: '${{!steps.release-check.outputs.IS_RELEASE}}'