Skip to content

Commit d7d7f62

Browse files
authored
Retry code coverage upload on failure (#3242)
### Description Noticed in several results of https://github.com/opensearch-project/security/actions/runs/5978371801/job/16220344142?pr=3123 that the code coverage upload had failed silently, and the annotations make it look like many tests were not executed. Since in this job there were 9 failures at the same time, adding retry mechanism as well to prevent blind restarting of workflows. ### Additional background Solution sourced from this stackoverflow question "How to automatically retry github action jobs on failure?" [1] - [1] https://stackoverflow.com/questions/71574593/how-to-automatically-retry-github-action-jobs-on-failure ### Check List - [ ] New functionality includes testing - [ ] New functionality has been documented - [X] Commits are signed per the DCO using --signoff By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin). Signed-off-by: Peter Nied <petern@amazon.com>
1 parent ed61646 commit d7d7f62

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,15 @@ jobs:
6060
${{ matrix.gradle_task }} -Dbuild.snapshot=false
6161
6262
- name: Coverage
63-
uses: codecov/codecov-action@v3
63+
uses: Wandalen/wretry.action@v1.3.0
6464
with:
65-
token: ${{ secrets.CODECOV_TOKEN }}
66-
files: ./build/reports/jacoco/test/jacocoTestReport.xml
65+
attempt_limit: 3
66+
attempt_delay: 2000
67+
action: codecov/codecov-action@v3
68+
with: |
69+
token: ${{ secrets.CODECOV_TOKEN }}
70+
fail_ci_if_error: true
71+
files: ./build/reports/jacoco/test/jacocoTestReport.xml
6772
6873
- uses: actions/upload-artifact@v3
6974
if: always()

0 commit comments

Comments
 (0)