diff --git a/.github/workflows/CI-python.yml b/.github/workflows/CI-python.yml index 9e79e6da..237a6b56 100644 --- a/.github/workflows/CI-python.yml +++ b/.github/workflows/CI-python.yml @@ -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