forked from metomi/isodatetime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
50 lines (46 loc) · 1.32 KB
/
.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Configuration for running isodatetime tests on Travis CI
# See https://travis-ci.org/ for more info.
---
language: python
python:
- 2.6
- 2.7
env:
- RUN_COVERAGE=false
- RUN_COVERAGE=true
matrix:
fast_finish: true
exclude:
- python: 2.6
env: RUN_COVERAGE=true
- python: 2.7
env: RUN_COVERAGE=false
before_install:
# Coverage dependencies
- pip install coverage pytest-cov
# Code style dependencies
- pip install pycodestyle
script:
- |
export COVERAGE_PROCESS_START="${TRAVIS_BUILD_DIR}/.coveragerc"
# NOTE: the way to handle long-living commands in the documentation is
# travis_wait 40 coverage run -m isodatetime.tests
# but it does not produce any output, which can be frustrating in case of errors.
# So here we are using the approach documented in the issue
# https://github.com/travis-ci/travis-ci/issues/4190.
coverage run -m isodatetime.tests &
minutes=0
limit=40
while kill -0 $! >/dev/null 2>&1; do
echo -n -e " \b" # never leave evidences!
if [ $minutes == $limit ]; then
break;
fi
minutes=$((minutes+1))
sleep 60
done
after_script:
- coverage xml --ignore-errors
# Report metrics, such as coverage
- '[[ "$RUN_COVERAGE" = true ]] && bash <(curl -s https://codecov.io/bash)'
- pycodestyle -v isodatetime