forked from evergreen-ci/evergreen.py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.evergreen.yml
118 lines (98 loc) · 2.32 KB
/
.evergreen.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
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
116
117
118
buildvariants:
- display_name: Ubuntu 16.04
name: ubuntu1604
run_on:
- ubuntu1604-test
tasks:
- name: unit_tests
- name: validate_requirements
- name: yapf_src
- name: deploy
display_tasks:
- name: yapf
execution_tasks:
- yapf_src
functions:
create virtualenv:
- command: shell.exec
params:
working_dir: src
script: |
set -o errexit
virtualenv --python=/opt/mongodbtoolchain/v3/bin/python3 venv
. venv/bin/activate
pip install -r requirements.txt.freeze
run yapf:
- command: shell.exec
params:
working_dir: src
script: |
set -o errexit
. venv/bin/activate
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
yapf-junit --target-dir ${target_directory} --out-file junit-yapf.xml --yapf-config .style.yapf
validate requirements:
- command: shell.exec
params:
working_dir: src
script: |
set -o errexit
. venv/bin/activate
pip freeze --local --requirement ${requirements_file} > pip.freeze
diff ${requirements_file}.freeze pip.freeze
upload code coverage:
- command: shell.exec
params:
working_dir: src
script: |
set -o errexit
. venv/bin/activate
coverage combine
COVERALLS_REPO_TOKEN=${coveralls_repo_token} coveralls
deploy:
- command: shell.exec
params:
working_dir: src
script: |
set -o errexit
. venv/bin/activate
if [ "${is_patch}" = "true" ]; then
# Do not deploy on patches.
exit 0
fi
scripts/deploy.sh ${pypi_user} ${pypi_password}
pre:
- command: git.get_project
params:
directory: src
- func: create virtualenv
post:
- command: attach.xunit_results
params:
file: src/junit-*.xml
tasks:
- name: unit_tests
commands:
- command: shell.exec
params:
working_dir: src
script: |
set -o errexit
. venv/bin/activate
tox
- func: upload code coverage
- name: yapf_src
commands:
- func: run yapf
vars:
target_directory: src
- name: validate_requirements
commands:
- func: validate requirements
vars:
requirements_file: requirements.txt
- name: deploy
patchable: false
commands:
- func: deploy