-
Notifications
You must be signed in to change notification settings - Fork 7
/
travis.yml.jj2
115 lines (108 loc) · 2.36 KB
/
travis.yml.jj2
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{% if not lint_command and lint_command != False %}
{% set lint_command = 'flake8' %}
{% endif %}
{% if not moban_command and moban_command != False %}
{% if mobanfile %}
{% set moban_command = 'moban -m ' + mobanfile %}
{% else %}
{% set moban_command = 'moban' %}
{% endif %}
{% endif %}
sudo: false
dist: {{ travis_dist | default('xenial') }}
language: python
notifications:
email: false
{%block test_other_environments%}
{%endblock%}
{%block custom_python_versions%}
python:
- &pypy2 pypy2.7-6.0
- &pypy3 pypy3.5-6.0
- 3.8
- 3.7
- 3.6
- 3.5
- 2.7
{%endblock%}
{%block exclusion_matrix%}
{%endblock%}
{%block extra_matrix%}
{%endblock%}
{% block stages %}
stages:
{% if lint_command != False %}
- lint
{% endif %}
{% if moban_command != False %}
- moban
{% endif %}
- test
{% endblock %}
{% if lint_command != False %}
.lint: &lint
git:
submodules: false
python: 3.6
env:
- MINREQ=0
stage: lint
{% if lint_command == 'flake8' %}
install: pip install flake8
{% endif %}
script: {{ lint_command }}
{% endif %}
{% if moban_command != False %}
.moban: &moban
python: 3.6
env:
- MINREQ=0
stage: moban
install: pip install moban gitfs2 pypifs moban-jinja2-github moban-ansible
{% if moban_command.startswith('moban') and 'exit-code' not in moban_command %}
script:
- {{ moban_command }}
{% if moban_allow_trailing_whitespace %}
- git diff
- git diff --ignore-blank-lines |
while read line; do if [ "$line" ]; then exit 1; fi; done
{% else %}
- git diff --exit-code
{% endif %}
{% else %}
script: {{ moban_command }}
{% endif %}
{% endif %}
{% block extra_dot_blocks %}
{% endblock %}
{% block jobs %}
jobs:
include:
- *moban
- *lint
{% block extra_jobs %}
{% endblock %}
{% endblock %}
stage: test
{% block before_install %}
before_install:
{% block custom_install %}
{% endblock%}
- if [[ -f min_requirements.txt && "$MINREQ" -eq 1 ]]; then
mv min_requirements.txt requirements.txt ;
fi
- test ! -f rnd_requirements.txt ||
pip install --no-deps -r rnd_requirements.txt
- test ! -f rnd_requirements.txt || pip install -r rnd_requirements.txt ;
- pip install -r tests/requirements.txt
{% endblock %}
{% block before_script %}
{% endblock %}
script:
{% block script %}
- {{ test_command | default('make test') }}
{% endblock %}
{% block end %}
after_success:
codecov
{% endblock %}