diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 00000000000..4959f25e521 --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,20 @@ +name: coverage +on: + workflow_run: + workflows: [tests, minimum] + types: [completed] +jobs: + codecov: + name: codecov + runs-on: ubuntu-latest + needs: [pytest, minimum] + steps: + - name: Clone repo + uses: actions/checkout@v4.1.1 + - name: Download coverage artifacts + uses: actions/download-artifact@v4.1.1 + - name: Report coverage + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 281a6750fe2..972c12ec9fb 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -81,10 +81,11 @@ jobs: run: | pytest --cov=torchgeo --cov-report=xml --durations=10 python3 -m torchgeo --help - - name: Report coverage - uses: codecov/codecov-action@v3.1.5 + - name: Upload coverage artifact + uses: actions/upload-artifact@v4.3.0 with: - token: ${{ secrets.CODECOV_TOKEN }} + name: coverage_${{ matrix.os }}_py-${{ matrix.python-version }} + path: coverage.xml minimum: name: minimum runs-on: ubuntu-latest @@ -120,10 +121,11 @@ jobs: run: | pytest --cov=torchgeo --cov-report=xml --durations=10 python3 -m torchgeo --help - - name: Report coverage - uses: codecov/codecov-action@v3.1.5 + - name: Upload coverage artifact + uses: actions/upload-artifact@v4.3.0 with: - token: ${{ secrets.CODECOV_TOKEN }} + name: coverage_minimum + path: coverage.xml concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }} cancel-in-progress: true