From aad739eceb89dc015670dc164f195cd19e3c4901 Mon Sep 17 00:00:00 2001 From: Peter Nied Date: Fri, 25 Aug 2023 18:20:04 +0000 Subject: [PATCH] Retry code coverage upload on failure 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. Signed-off-by: Peter Nied --- .github/workflows/ci.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c86f82e26..537e7836f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,10 +60,15 @@ jobs: ${{ matrix.gradle_task }} -Dbuild.snapshot=false - name: Coverage - uses: codecov/codecov-action@v3 + uses: Wandalen/wretry.action with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./build/reports/jacoco/test/jacocoTestReport.xml + attempt_limit: 3 + attempt_delay: 2000 + action: codecov/codecov-action@v3 + with: | + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true + files: ./build/reports/jacoco/test/jacocoTestReport.xml - uses: actions/upload-artifact@v3 if: always()