Skip to content

Commit 06a60fd

Browse files
authored
Merge pull request #1008 from nipy/ci/harden_codecov
CI: Submit coverage to codecov via pinned PyPI package
2 parents cb110b0 + 710dadb commit 06a60fd

File tree

5 files changed

+28
-10
lines changed

5 files changed

+28
-10
lines changed

.github/workflows/misc.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ jobs:
5151
- name: Run tests
5252
run: tools/ci/check.sh
5353
if: ${{ matrix.check != 'skiptests' }}
54-
- uses: codecov/codecov-action@v1
55-
with:
56-
file: for_testing/coverage.xml
54+
- name: Submit coverage
55+
run: tools/ci/submit_coverage.sh
5756
if: ${{ always() }}
5857
- name: Upload pytest test results
5958
uses: actions/upload-artifact@v2

.github/workflows/pre-release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ jobs:
7474
- name: Run tests
7575
run: tools/ci/check.sh
7676
if: ${{ matrix.check != 'skiptests' }}
77-
- uses: codecov/codecov-action@v1
78-
with:
79-
file: for_testing/coverage.xml
77+
- name: Submit coverage
78+
run: tools/ci/submit_coverage.sh
8079
if: ${{ always() }}
8180
- name: Upload pytest test results
8281
uses: actions/upload-artifact@v2

.github/workflows/stable.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ jobs:
117117
- name: Run tests
118118
run: tools/ci/check.sh
119119
if: ${{ matrix.check != 'skiptests' }}
120-
- uses: codecov/codecov-action@v1
121-
with:
122-
file: for_testing/coverage.xml
120+
- name: Submit coverage
121+
run: tools/ci/submit_coverage.sh
123122
if: ${{ always() }}
124123
- name: Upload pytest test results
125124
uses: actions/upload-artifact@v2

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test =
5959
coverage
6060
pytest !=5.3.4
6161
pytest-cov
62-
pytest-doctestplus
62+
pytest-doctestplus !=0.9.0
6363
all =
6464
%(dicomfs)s
6565
%(dev)s

tools/ci/submit_coverage.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
echo Submitting coverage
4+
5+
source tools/ci/activate.sh
6+
7+
set -eu
8+
9+
set -x
10+
11+
COVERAGE_FILE="for_testing/coverage.xml"
12+
13+
if [ -e "$COVERAGE_FILE" ]; then
14+
# Pin codecov version to reduce scope for malicious updates
15+
python -m pip install "codecov==2.1.11"
16+
python -m codecov --file for_testing/coverage.xml
17+
fi
18+
19+
set +eux
20+
21+
echo Done submitting coverage

0 commit comments

Comments
 (0)