Skip to content

Commit

Permalink
Try to rerun cypress 2 more times if cypress fails
Browse files Browse the repository at this point in the history
  • Loading branch information
AshCorr committed May 26, 2023
1 parent 1d1f005 commit c58e3d6
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,38 @@ jobs:
cache: 'yarn'

- name: Cypress run
id: cypress-1
uses: cypress-io/github-action@v5
with:
working-directory: dotcom-rendering
wait-on: "http://localhost:9000"
wait-on-timeout: 30
browser: chrome
spec: cypress/e2e/parallel-${{ matrix.group }}/*.js

- name: Cypress run 2
id: cypress-2
# A default
if: ${failure() && steps.cypress-1.conclusion == 'failure'}}
uses: cypress-io/github-action@v5
with:
working-directory: dotcom-rendering
wait-on: "http://localhost:9000"
wait-on-timeout: 30
browser: chrome
spec: cypress/e2e/parallel-${{ matrix.group }}/*.js

- name: Cypress run 3
id: cypress-3
if: ${{failure() && steps.cypress-2.conclusion == 'failure'}}
uses: cypress-io/github-action@v5
with:
working-directory: dotcom-rendering
wait-on: "http://localhost:9000"
wait-on-timeout: 30
browser: chrome
spec: cypress/e2e/parallel-${{ matrix.group }}/*.js

- name: Did any cypress run pass?
if: ${{failure() && steps.cypress-1.conclusion == 'failure' && steps.cypress-2.conclusion == 'failure' && steps.cypress-3.conclusion == 'failure'}}
run: exit 1

0 comments on commit c58e3d6

Please sign in to comment.