-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
68 lines (58 loc) · 1.66 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
language: python
sudo: disabled
python:
- "2.7"
os:
- linux
git:
depth: 1
env:
global:
- RADICAL_PILOT_DBURL=mongodb://rct:[email protected]/rct_test
- RADICAL_PILOT_TEST_DBNAME=rct_test
- LOG=`git log -n 1 | grep Merge`
- OLD=`echo $LOG | cut -d ' ' -f2`
- NEW=`echo $LOG | cut -d ' ' -f3`
- DIFF=`git diff --name-only --diff-filter=b $OLD...$NEW`
- DIFF=$(echo $DIFF | grep -o -e '\b[^ ]*.py\b')
- LOC=/home/travis/virtualenv/python2.7 # Location where VE is created on travis
- CMD_PYTEST="coverage run -m pytest -vvv tests/"
- CMD_FLAKE8="if ! test -z \"$DIFF\"; then flake8 --config=.flake8 $DIFF;else echo 'Nothing to pep8'; fi"
- CMD_PYLINT="if ! test -z \"$DIFF\"; then pylint $DIFF;else echo 'Nothing to lint';fi"
- CMD_FLAKE8_TESTS="flake8 --config=.flake8 tests/"
- CMD_PYLINT_TESTS="pylint tests/"
- COVERAGE=false
- CODECOV_TOKEN="8488b0ed-2a4d-4a30-b5b0-3e742bdc4381"
matrix:
- MAIN_CMD=$CMD_PYTEST COVERAGE=true
- MAIN_CMD=$CMD_FLAKE8
- MAIN_CMD=$CMD_PYLINT
- MAIN_CMD=$CMD_FLAKE8_TESTS
- MAIN_CMD=$CMD_PYLINT_TESTS
before_install:
- uname -a
- ulimit -a
- python -V
# command to install dependencies
install:
- pip install .
- pip install coverage
- pip install flake8
- pip install pylint
- pip install codecov
script:
- echo $MAIN_CMD
- eval $MAIN_CMD
after_success:
- |
if [[ $COVERAGE == 'true' ]]; then \
coverage combine; \
coverage xml; \
coverage report; \
curl -s https://codecov.io/bash | bash
fi
notifications:
email:
recipients: [email protected]
on_success: change
on_failure: always