GeezerVison is showing github.com — [ISSUE #8544] Add a retry mechanism to the unit test pipeline (#8545) · lltopk/rocketmq@b512ba1
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/bazel.yml +11-1Lines changed: 11 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
7 | 7 | - master |
8 | 8 | - develop |
9 | 9 | - bazel |
| 10 | + |
10 | 11 | jobs: |
11 | 12 | build: |
12 | 13 | name: "bazel-compile (${{ matrix.os }})" |
|
19 | 20 | - name: Build |
20 | 21 | run: bazel build --config=remote //... |
21 | 22 | - name: Run Tests |
22 | | - run: bazel test --config=remote //... |
| 23 | + run: bazel test --config=remote //... |
| 24 | + - name: Retry if failed |
| 25 | + # if it failed , retry 2 times at most |
| 26 | + if: failure() && fromJSON(github.run_attempt) < 3 |
| 27 | + env: |
| 28 | + GH_REPO: ${{ github.repository }} |
| 29 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 30 | + run: | |
| 31 | + echo "Attempting to retry workflow..." |
| 32 | + gh workflow run rerun-workflow.yml -F run_id=${{ github.run_id }} |
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/maven.yaml +10-1Lines changed: 10 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
31 | 31 | with: |
32 | 32 | name: jvm-crash-logs |
33 | 33 | path: /Users/runner/work/rocketmq/rocketmq/auth/hs_err_pid*.log |
34 | | - retention-days: 1 |
| 34 | + retention-days: 1 |
| 35 | + - name: Retry if failed |
| 36 | + # if it failed , retry 2 times at most |
| 37 | + if: failure() && fromJSON(github.run_attempt) < 3 |
| 38 | + env: |
| 39 | + GH_REPO: ${{ github.repository }} |
| 40 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 41 | + run: | |
| 42 | + echo "Attempting to retry workflow..." |
| 43 | + gh workflow run rerun-workflow.yml -F run_id=${{ github.run_id }} |
Collapse file
Copy file name to clipboard +18Lines changed: 18 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +name: Rerun workflow |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + inputs: |
| 5 | + run_id: |
| 6 | + required: true |
| 7 | + |
| 8 | +jobs: |
| 9 | + rerun: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: rerun ${{ inputs.run_id }} |
| 13 | + env: |
| 14 | + GH_REPO: ${{ github.repository }} |
| 15 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 16 | + run: | |
| 17 | + gh run watch ${{ inputs.run_id }} > /dev/null 2>&1 |
| 18 | + gh run rerun ${{ inputs.run_id }} --failed |