From e301c6b9863c573ecfa7947a409f61479d8223fb Mon Sep 17 00:00:00 2001 From: Ryan May Date: Tue, 17 Oct 2023 13:16:17 -0600 Subject: [PATCH] CI: Move codecov upload to a separate job This should reduce the number of calls, putting less stress on the system and resulting in fewer opportunities to fail. It also makes it easier to retry just the upload with no need to re-run the tests. --- .codecov.yml | 4 ---- .github/actions/run-tests/action.yml | 8 +++++--- .github/workflows/tests-conda.yml | 17 +++++++++++++++++ .github/workflows/tests-pypi.yml | 17 +++++++++++++++++ 4 files changed, 39 insertions(+), 7 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index db01d813986..c3c24e637d1 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,7 +1,3 @@ -codecov: - notify: - after_n_builds: 9 - coverage: status: patch: diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml index ead48b1736e..88c831fb77b 100644 --- a/.github/actions/run-tests/action.yml +++ b/.github/actions/run-tests/action.yml @@ -45,8 +45,10 @@ runs: name: ${{ inputs.key }}-images path: test_output/ - - name: Upload coverage - if: ${{ always() && inputs.upload-coverage == 'true' }} - uses: codecov/codecov-action@v3 + - name: Upload coverage artifact + if: ${{ inputs.upload-coverage == 'true' }} + uses: actions/upload-artifact@v3 with: name: ${{ inputs.key }} + path: coverage.xml + retention-days: 7 diff --git a/.github/workflows/tests-conda.yml b/.github/workflows/tests-conda.yml index d118d8725b2..781521a0a15 100644 --- a/.github/workflows/tests-conda.yml +++ b/.github/workflows/tests-conda.yml @@ -49,3 +49,20 @@ jobs: with: run-doctests: ${{ runner.os != 'Windows' }} key: conda-${{ matrix.python-version }}-${{ runner.os }} + + codecov: + name: CodeCov Upload + needs: CondaTests + runs-on: ubuntu-latest + timeout-minutes: 2 + steps: + - name: Checkout source + uses: actions/checkout@v4 + + - name: Download coverage artifacts + uses: actions/download-artifact@v3 + + - name: Upload coverage + uses: codecov/codecov-action@v3 + with: + name: ${{ github.workflow }} diff --git a/.github/workflows/tests-pypi.yml b/.github/workflows/tests-pypi.yml index 876fe5cabcb..e7a34129182 100644 --- a/.github/workflows/tests-pypi.yml +++ b/.github/workflows/tests-pypi.yml @@ -75,3 +75,20 @@ jobs: with: run-doctests: ${{ matrix.dep-versions == 'requirements.txt' && matrix.no-extras != 'No Extras' }} key: pypi-${{ matrix.python-version }}-${{ matrix.dep-versions }}-${{ matrix.no-extras }}-${{ runner.os }} + + codecov: + needs: PyPITests + name: CodeCov Upload + runs-on: ubuntu-latest + timeout-minutes: 2 + steps: + - name: Checkout source + uses: actions/checkout@v4 + + - name: Download coverage artifacts + uses: actions/download-artifact@v3 + + - name: Upload coverage + uses: codecov/codecov-action@v3 + with: + name: ${{ github.workflow }}