File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- set -e
3
+ set -euo pipefail
4
4
set -x
5
5
6
- if [ -z " $TOXENV " ]; then
6
+ # Install coverage.
7
+ if [[ -z ${TOXENV+x} || -z $TOXENV ]]; then
7
8
python -m pip install coverage
8
9
else
9
10
# Add last TOXENV to $PATH.
10
11
PATH=" $PWD /.tox/${TOXENV##* ,} /bin:$PATH "
11
12
fi
12
13
14
+ # Run coverage.
13
15
python -m coverage xml
16
+
17
+ # Download and verify latest Codecov bash uploader.
14
18
# Set --connect-timeout to work around https://github.com/curl/curl/issues/4461
15
- curl -S -L --connect-timeout 5 --retry 6 -s https://codecov.io/bash -o codecov-upload.sh
16
- bash codecov-upload.sh -Z -X fix -f coverage.xml " $@ "
19
+ curl --silent --show-error --location --connect-timeout 5 --retry 6 -o codecov https://codecov.io/bash
20
+ VERSION=$( grep --only-matching ' VERSION=\"[0-9\.]*\"' codecov | cut -d' "' -f2)
21
+ if command -v sha256sum; then
22
+ sha256sum --check --strict --ignore-missing --quiet <( curl --silent " https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION} /SHA256SUM" )
23
+ else
24
+ shasum --algorithm 256 --check --strict --ignore-missing --quiet <( curl --silent " https://raw.githubusercontent.com/codecov/codecov-bash/${VERSION} /SHA256SUM" )
25
+ fi
26
+
27
+ # Upload coverage.
28
+ bash codecov -Z -X fix -f coverage.xml " $@ "
You can’t perform that action at this time.
0 commit comments