1- {% if lint_command %}
2- {% set lint = lint_command%}
3- {% else %}
4- {% set lint = 'flake8' %}
1+ {% if not lint_command and lint_command != False %}
2+ {% set lint_command = 'flake8' %}
3+ {% endif %}
4+ {% if not moban_command and moban_command != False %}
5+ {% if mobanfile %}
6+ {% set moban_command = 'moban -m ' + mobanfile %}
7+ {% else %}
8+ {% set moban_command = 'moban' %}
9+ {% endif %}
510{% endif %}
6-
711sudo: false
8- dist: xenial
12+ dist: {{ travis_dist | default(' xenial') }}
913language: python
1014notifications:
1115 email: false
@@ -26,42 +30,97 @@ python:
2630{%block extra_matrix%}
2731{%endblock%}
2832
33+ {% block stages %}
2934stages:
3035 - test
36+ {% if lint_command != False %}
3137 - lint
38+ {% endif %}
39+ {% if moban_command != False %}
40+ - moban
41+ {% endif %}
3242
43+ {% endblock %}
3344.disable_global: &disable_global
45+ addons: false
46+ cache: false
47+ env: {}
48+ python: false
3449 before_install: false
35- install: true
50+ install: false
3651 before_script: false
52+ script: false
3753 after_success: false
3854 after_failure: false
55+ before_deploy: false
56+ deploy: false
3957
58+ {% if lint_command != False %}
4059.lint: &lint
4160 <<: *disable_global
61+ git:
62+ submodules: false
4263 python: 3.6
4364 stage: lint
65+ {% if lint_command == 'flake8' %}
4466 install: pip install flake8
45- script: {{ lint }}
67+ {% endif %}
68+ script: {{ lint_command }}
69+
70+ {% endif %}
71+ {% if moban_command != False %}
72+ .moban: &moban
73+ <<: *disable_global
74+ python: 3.6
75+ stage: moban
76+ install: pip install moban>=0.0.4
77+ {% if moban_command.startswith('moban') and 'exit-code' not in moban_command %}
78+ script:
79+ - {{ moban_command }}
80+ {% if moban_allow_trailing_whitespace %}
81+ - git diff
82+ - git diff --ignore-blank-lines |
83+ while read line; do if [ "$line" ]; then exit 1; fi; done
84+ {% else %}
85+ - git diff --exit-code
86+ {% endif %}
87+ {% else %}
88+ script: {{ moban_command }}
89+ {% endif %}
4690
91+ {% endif %}
92+ {% block extra_dot_blocks %}
93+ {% endblock %}
94+ {% block jobs %}
4795jobs:
4896 include:
97+ - *moban
4998 - *lint
99+ {% block extra_jobs %}
100+ {% endblock %}
101+ {% endblock %}
50102
51103stage: test
52104
53- script: make test
54-
105+ {% block before_install %}
55106before_install:
56107{% block custom_install %}
57108{% endblock%}
58109 - if [[ -f min_requirements.txt && "$MINREQ" -eq 1 ]]; then
59110 mv min_requirements.txt requirements.txt ;
60111 fi
61- - test ! -f rnd_requirements.txt || pip install --no-deps -r rnd_requirements.txt
112+ - test ! -f rnd_requirements.txt ||
113+ pip install --no-deps -r rnd_requirements.txt
62114 - test ! -f rnd_requirements.txt || pip install -r rnd_requirements.txt ;
63115 - pip install -r tests/requirements.txt
116+ {% endblock %}
117+ {% block before_script %}
118+ {% endblock %}
64119script:
65- - make test
120+ {% block script %}
121+ - {{ test_command | default('make test') }}
122+ {% endblock %}
123+ {% block end %}
66124after_success:
67125 codecov
126+ {% endblock %}
0 commit comments