-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
69 lines (60 loc) · 1.72 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
69
language: python
python:
- '3.6'
- '3.7'
os: linux
dist: bionic
git:
depth: 1
env:
global:
- RADICAL_PILOT_DBURL=mongodb://ci-test:[email protected]/ci-test
- RADICAL_PILOT_TEST_DBNAME=ci-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/python3.6 # 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="62c13cf3-c8de-4b94-b790-5c11c322dbc3"
jobs:
- MAIN_CMD=$CMD_PYTEST COVERAGE=false
- 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
- pip install radical.pilot
- pip install radical.entk
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