This repository has been archived by the owner on Nov 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
70 lines (60 loc) · 2.78 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
70
language: python
cache: pip
jobs:
include:
- name: "Tests on python 2.7 (Hasta)"
python: "2.7.15" # on P_deliver
install: pip install . -r requirements-dev.txt
script: pytest
- name: "Package install"
if: type = pull_request
python: "2.7.15" # on P_deliver
install: python setup.py install
script: pip check
- name: "Production dependencies on Hasta"
if: type = pull_request
python: "2.7.15" # on P_deliver
install:
- pip install pip==19.0.1 # pip version in P_deliver
- pip install cython
- pip install .
script: pip check
- name: "Development dependencies"
if: type = pull_request
python: "2.7.15" # on P_deliver
install:
- pip install cython
- pip install . -r requirements-dev.txt
script: pip check
- name: "Coverage"
if: NOT type = pull_request
python: "2.7.15" # on P_deliver
install:
- pip install cython
- pip install . -r requirements-dev.txt
script: coverage run --branch --omit="*.html" --source "$(basename "$PWD")" setup.py test
after_success: coveralls
- name: "Code formatting"
if: type = pull_request
install: pip install black
script: git --no-pager diff --name-only --diff-filter=AM $TRAVIS_COMMIT_RANGE | grep -F ".py" | xargs black --check
- name: "Pylint score"
if: type = pull_request
install: pip install pylint
script:
- grep -r -E "pylint. {0,1}disable\=" .; if [ $? -eq 0 ]; then echo "Can not run pylint scoring with any pylint warnings disabled, please remove them and try again" && false; else true; fi
- (git --no-pager diff --name-only --diff-filter=M $TRAVIS_COMMIT_RANGE | grep -F ".py" || echo "$(basename "$PWD")") > $TRAVIS_HOME/before_files.txt
- (git --no-pager diff --name-only --diff-filter=AM $TRAVIS_COMMIT_RANGE | grep -F ".py" || echo "$(basename "$PWD")") > $TRAVIS_HOME/after_files.txt
- pylint --rcfile=.configs/pylintrc --jobs=0 --exit-zero $(< $TRAVIS_HOME/after_files.txt) > $TRAVIS_HOME/pylint_after_output.txt
- git checkout $TRAVIS_BRANCH
- pylint --rcfile=.configs/pylintrc --jobs=0 --exit-zero $(< $TRAVIS_HOME/before_files.txt) > $TRAVIS_HOME/pylint_before_output.txt
- >-
grep -F "/10, -" $TRAVIS_HOME/pylint_before_output.txt ||
grep -F "/10, +0.00" $TRAVIS_HOME/pylint_before_output.txt ||
(echo "pylint score decreased, please try again after fixing some lint issues." && cat $TRAVIS_HOME/pylint_after_output.txt && false)
- name: "Linting"
if: type = pull_request
install: pip install -r requirements-dev.txt
script: git reset --soft ${TRAVIS_COMMIT_RANGE%...*} && git lint
notifications:
email: never