Skip to content

Commit

Permalink
add re-run job to e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hansmorb committed Oct 11, 2024
1 parent 7a7cfc3 commit aa31d5c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,13 @@ jobs:
with:
name: cypress-screenshots-${{ matrix.php }}_${{ matrix.core.name }}
path: ${{ github.workspace }}/tests/cypress/screenshots/
rerun-on-failure:
needs: e2e
if: failure() && fromJSON(github.run_attempt) < 3
runs-on: ubuntu-latest
steps:
- env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
GH_DEBUG: api
run: gh workflow run rerun.yml -r ${{ github.head_ref || github.ref_name }} -F run_id=${{ github.run_id }}
19 changes: 19 additions & 0 deletions .github/workflows/rerun.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Rerun workflow

on:
workflow_dispatch:
inputs:
run_id:
required: true
jobs:
rerun:
runs-on: ubuntu-latest
steps:
- name: rerun ${{ inputs.run_id }}
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
GH_DEBUG: api
run: |
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
gh run rerun ${{ inputs.run_id }} --failed

0 comments on commit aa31d5c

Please sign in to comment.