Skip to content

Commit

Permalink
CI: Move codecov upload to a separate job
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dopplershift committed Oct 17, 2023
1 parent 85669e2 commit 928df0a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/actions/run-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 17 additions & 0 deletions .github/workflows/tests-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
17 changes: 17 additions & 0 deletions .github/workflows/tests-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

0 comments on commit 928df0a

Please sign in to comment.