Skip to content

Commit

Permalink
fix flaky codecov errors in interpret-community by adding retry logic…
Browse files Browse the repository at this point in the history
… for uploads (#575)
  • Loading branch information
imatiach-msft authored Aug 23, 2023
1 parent 658fd84 commit 72c2738
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/CI-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,43 @@ jobs:
path: htmlcov
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
- name: Upload coverage to Codecov

- if: ${{ matrix.pythonVersion == '3.8' }}
name: Upload to codecov
id: codecovupload1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: .
env_vars: OS,PYTHON
fail_ci_if_error: false
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
path_to_write_report: ./coverage/codecov_report.txt
verbose: true

- if: ${{ (steps.codecovupload1.outcome == 'failure') && (matrix.pythonVersion == '3.8') }}
name: Retry upload to codecov
id: codecovupload2
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: .
env_vars: OS,PYTHON
fail_ci_if_error: true
fail_ci_if_error: false
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
path_to_write_report: ./coverage/codecov_report.txt
verbose: true

- if: ${{ matrix.pythonVersion == '3.8' }}
name: Set codecov status
shell: bash
run: |
if ${{ (steps.codecovupload1.outcome == 'success') || (steps.codecovupload2.outcome == 'success') }} ; then
echo fine
else
exit 1
fi

0 comments on commit 72c2738

Please sign in to comment.