From 9341c5766505338ac3a77bb33fedf30107ce4869 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Mon, 17 Apr 2023 08:54:32 -0400 Subject: [PATCH] CI: Switch to codecov action --- .github/workflows/misc.yml | 3 --- .github/workflows/pre-release.yml | 5 +++-- .github/workflows/stable.yml | 5 +++-- tools/ci/check.sh | 2 +- tools/ci/submit_coverage.sh | 21 --------------------- 5 files changed, 7 insertions(+), 29 deletions(-) delete mode 100755 tools/ci/submit_coverage.sh diff --git a/.github/workflows/misc.yml b/.github/workflows/misc.yml index ade350aaa7..90645b40eb 100644 --- a/.github/workflows/misc.yml +++ b/.github/workflows/misc.yml @@ -59,9 +59,6 @@ jobs: - name: Run tests run: tools/ci/check.sh if: ${{ matrix.check != 'skiptests' }} - - name: Submit coverage - run: tools/ci/submit_coverage.sh - if: ${{ always() }} - name: Upload pytest test results uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 9ceb4033ae..630f09d99b 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -87,9 +87,10 @@ jobs: - name: Run tests run: tools/ci/check.sh if: ${{ matrix.check != 'skiptests' }} - - name: Submit coverage - run: tools/ci/submit_coverage.sh + - uses: codecov/codecov-action@v3 if: ${{ always() }} + with: + files: cov.xml - name: Upload pytest test results uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 315534107f..18a30d6d07 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -181,9 +181,10 @@ jobs: - name: Run tests if: ${{ matrix.check != 'skiptests' }} run: tools/ci/check.sh - - name: Submit coverage + - uses: codecov/codecov-action@v3 if: ${{ always() }} - run: tools/ci/submit_coverage.sh + with: + files: cov.xml - name: Upload pytest test results if: ${{ always() && matrix.check == 'test' }} uses: actions/upload-artifact@v3 diff --git a/tools/ci/check.sh b/tools/ci/check.sh index bcb1a934e2..cd90650722 100755 --- a/tools/ci/check.sh +++ b/tools/ci/check.sh @@ -23,7 +23,7 @@ elif [ "${CHECK_TYPE}" == "test" ]; then mkdir for_testing cd for_testing cp ../.coveragerc . - pytest --doctest-modules --doctest-plus --cov nibabel --cov-report xml \ + pytest --doctest-modules --doctest-plus --cov nibabel --cov-report xml:../cov.xml \ --junitxml=test-results.xml -v --pyargs nibabel -n auto elif [ "${CHECK_TYPE}" == "typing" ]; then mypy nibabel diff --git a/tools/ci/submit_coverage.sh b/tools/ci/submit_coverage.sh deleted file mode 100755 index 17bfe3933b..0000000000 --- a/tools/ci/submit_coverage.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -echo Submitting coverage - -source tools/ci/activate.sh - -set -eu - -set -x - -COVERAGE_FILE="for_testing/coverage.xml" - -if [ -e "$COVERAGE_FILE" ]; then - # Pin codecov version to reduce scope for malicious updates - python -m pip install "codecov==2.1.11" - python -m codecov --file for_testing/coverage.xml -fi - -set +eux - -echo Done submitting coverage