From e351d929a426931d0972d0e71209b48fd7c40608 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. --- .github/actions/run-tests/action.yml | 8 +++++--- .github/workflows/tests-conda.yml | 14 ++++++++++++++ .github/workflows/tests-pypi.yml | 14 ++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) 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..28b78af32af 100644 --- a/.github/workflows/tests-conda.yml +++ b/.github/workflows/tests-conda.yml @@ -49,3 +49,17 @@ 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: 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..606a1b1f8f1 100644 --- a/.github/workflows/tests-pypi.yml +++ b/.github/workflows/tests-pypi.yml @@ -75,3 +75,17 @@ 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: Download coverage artifacts + uses: actions/download-artifact@v3 + + - name: Upload coverage + uses: codecov/codecov-action@v3 + with: + name: ${{ github.workflow }}