Skip to content

Commit

Permalink
ci: rerun integration tests on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
gao-sun committed Jun 29, 2024
1 parent e7cc05b commit 1052e27
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ concurrency:
cancel-in-progress: true

jobs:
fail:
runs-on: ubuntu-latest
steps:
- run: false

# Automatically rerun the workflow since the integration tests are moody
rerun-on-failure:
needs: fail
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 -F run_id=${{ github.run_id }}

package:
strategy:
matrix:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/rerun.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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 1052e27

Please sign in to comment.