-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
207 lines (185 loc) · 4.11 KB
/
.gitlab-ci.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
image: python
variables:
TWINE_USERNAME: SECURE
TWINE_PASSWORD: SECURE
TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/
SK_DEBUG: 1
before_script:
- curl -s -O https://bootstrap.pypa.io/get-pip.py
- python get-pip.py
- pip install -q -r requirements_dev.txt
after_script:
- pip install codecov
- make install-dev &> /dev/null
- sv_detect_software_versions python -q -p ${CI_JOB_NAME} -o software_versions.json
# - codecov --token=<>
stages:
- quick-checks
- build
- test
- validation
- deploy
- report
- cleanup
linters:
image: python:3.5
stage: quick-checks
script:
- make lint
# - tox -e linters
build:
stage: build
script:
- make install-dev
- make dist
artifacts:
paths:
- dist/
- software_versions.json
expire_in: 1 month
failed:build:
stage: build
script:
- exit 1
allow_failure: true
artifacts:
paths:
- software_versions.json
when: always
expire_in: 1 month
.test: &test_setup
stage: test
artifacts:
paths:
- software_versions.json
when: always
expire_in: 1 month
python2:
<<: *test_setup
image: python:2.7
script: tox -e py27
python36:
<<: *test_setup
image: python:3.6
script: tox -e py36
python37:
<<: *test_setup
image: python:3.7
script: tox -e py37
docs:
<<: *test_setup
script: make docs
validate-root-diff-1_2:
image: python:3.7
stage: validation
script:
- make install
- mkdir -p output/validate
- sv_root_diff tests/samples/test_1.root tests/samples/test_2.root --output-path=output/validate -r output/validate/root_comparison.json
artifacts:
paths:
- output/validate
- software_versions.json
expire_in: 1 week
validate-root-diff-1_3:
image: python:3.7
stage: validation
script:
- make install
- mkdir -p output/validate
- sv_root_diff tests/samples/test_1.root tests/samples/test_3.root --output-path=output/validate -r output/validate/root_comparison.json
artifacts:
paths:
- output/validate
- software_versions.json
expire_in: 1 week
validate:demo_report:
image: python:3.7
stage: validation
script:
- make install
- sv_make_demo_report
- test -f demo_report.md
artifacts:
paths:
- demo_report.md
- software_versions.json
expire_in: 1 week
validate:metric_pipeline:
image: python:3.7
stage: validation
script:
- make install-dev
- apt update && apt install stress
- source .ci/test_metric_pipeline.sh
- sv_make_demo_report
- test -f demo_report.md
artifacts:
paths:
- demo_report.md
- software_versions.json
- output
expire_in: 1 week
validate:metric_pipeline_ref:
image: python:3.7
stage: validation
script:
- make install-dev
- apt update && apt install stress
- source .ci/test_metric_pipeline_ref.sh
- sv_make_demo_report
- test -f demo_report.md
artifacts:
paths:
- demo_report.md
- software_versions.json
- output
expire_in: 1 week
failed:validation:
stage: validation
script:
- exit 1
allow_failure: true
artifacts:
paths:
- software_versions.json
when: always
expire_in: 1 month
deploy_pypi:
stage: deploy
script:
- pip install -U twine setuptools
- python setup.py check sdist bdist_wheel
- twine upload dist/*
only:
- tags
except:
- branches
after_script: []
report:
stage: report
when: always
script:
- make install
- echo "sleeping for 60s to wait for artifacts to be uploaded for previous stages"; sleep 180
- sv_make_report .ci/ci_report.yml -o ci_report.md
- sv_submit_report_to_mr ci_report.md validation_report_*.md
dependencies:
- validate:metric_pipeline
artifacts:
paths:
- "*.md"
- "*.html"
- "*.pdf"
- "*.png"
- input
- output
expire_in: 1 week
after_script: []
cleanup_pypirc:
stage: cleanup
when: always # this is important; run even if preceding stages failed.
script:
- rm -vf ~/.pypirc # we don't want to leave these around, but GitLab may clean up anyway.
after_script: []
before_script: []