/
.travis.yml
35 lines (31 loc) · 1006 Bytes
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
language: python
python:
- "3.5"
- "3.6" # current default Python on Travis CI
- "3.7"
install:
- pip install tox-travis
# Because the tests access the first git commit, we need to fetch the whole
# pycobertura repository without using a git --depth parameter. See
# https://docs.travis-ci.com/user/customizing-the-build#git-clone-depth
git:
depth: false
script:
- tox
after_success:
- |
if [ ! -f coverage.xml ]; then
echo "No coverage.xml found; skipping sending coverage to couverture.io"
return
fi
if [ $TRAVIS_PULL_REQUEST != false ]; then
REAL_COMMIT=$(git log -n 1 $TRAVIS_COMMIT_RANGE --format="%H")
PR_NUM=$TRAVIS_PULL_REQUEST
else
REAL_COMMIT=$TRAVIS_COMMIT
fi
curl \
--verbose \
--header "X-Couverture-Pull-Request: $PR_NUM" \
--data-binary @coverage.xml \
"https://app.couverture.io/coverage/github/aconrad/pycobertura/$REAL_COMMIT/$TOXENV"