-
Notifications
You must be signed in to change notification settings - Fork 35
/
.gitlab-ci.yml
209 lines (184 loc) · 4.88 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
208
209
### DBND CI CD
### GENERAL CI CONFIG
### KNOWN ISSUES:
# `needs` doesn't work for failed job, the job after will run when the "needed" job is skipped
# A (fails) -> B (skip) -> C (runs!!!)
# default image to use
image: us.gcr.io/dbnd-dev-260010/databand/dbnd-ci-default:py310-latest-v3
stages:
- test
- build-base
- publish
- staging
- test-windows
- ci-utils
variables:
# Change pip's cache directory to be inside the project directory since we can
# only cache local items.
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
DOCKER_IMAGE_CI_PYTEST_MULTI: us.gcr.io/dbnd-dev-260010/databand/dbnd-ci-pytest:multi-v1
### TESTS BASIC
.template__except_defaults:
except: &except_on_skip_message
variables:
- $CI_COMMIT_MESSAGE =~ /skip-tests/
.template__on_every_commit:
only: &on_every_commit
- /^feature|fix/
- master
- merge_requests
- develop
- tags
.template__on_significant_branch_only:
only: &on_significant_branch
- master
- merge_requests
- develop
- tags
### TEST TEMPLATES
.template__basic_job: &template__basic_checks_job
stage: test
only: *on_every_commit
.template__test_python: &template__python_test_job
stage: test
except: *except_on_skip_message
.template__test_python__cpu_heavy: &template__python_test_job__cpu_heavy
<<: *template__python_test_job
variables:
KUBERNETES_CPU_REQUEST: 1200m
KUBERNETES_CPU_LIMIT: 2000m
KUBERNETES_MEMORY_REQUEST: 230Mi
KUBERNETES_MEMORY_LIMIT: 1Gi
.template__test_windows: &template__windows_tests_job
stage: test-windows
only: *on_significant_branch
except: *except_on_skip_message
needs: ["empty_job"]
before_script:
- echo "start"
- whoami
tags:
- windows
# TODO: new models - sqlalchemy_utils.UUID - not wokring on windows?
when: manual
empty_job:
# workaround for gitlab not supporting empty `needs`
# we want build jobs starting to run right away
stage: test
only: *on_significant_branch
variables:
KUBERNETES_CPU_REQUEST: 10m
KUBERNETES_CPU_LIMIT: 100m
KUBERNETES_MEMORY_REQUEST: 10Mi
KUBERNETES_MEMORY_LIMIT: 100Mi
script:
- echo "Hello World"
pre_commit:
<<: *template__python_test_job
variables:
KUBERNETES_CPU_REQUEST: 1200m
KUBERNETES_CPU_LIMIT: 2000m
KUBERNETES_MEMORY_REQUEST: 230Mi
KUBERNETES_MEMORY_LIMIT: 1Gi
image: ${DOCKER_IMAGE_CI_PYTEST_MULTI}
script:
# - tox -e pre-commit,docs,readme
- tox -e pre-commit,bumpversion-check
lint:
<<: *template__python_test_job__cpu_heavy
image: ${DOCKER_IMAGE_CI_PYTEST_MULTI}
script:
- tox -e lint,lint-tracking-airflow
manifest:
<<: *template__python_test_job
variables:
KUBERNETES_CPU_REQUEST: 250m
KUBERNETES_CPU_LIMIT: 1
KUBERNETES_MEMORY_REQUEST: 260Mi
KUBERNETES_MEMORY_LIMIT: 1Gi
image: ${DOCKER_IMAGE_CI_PYTEST_MULTI}
script:
- make test-manifest
test dbnd py37:
<<: *template__python_test_job
image: ${DOCKER_IMAGE_CI_PYTEST_MULTI}
script:
- cd modules/dbnd
- tox -e py37
artifacts:
reports:
junit: build/junit-py37.xml
test dbnd py39:
<<: *template__python_test_job
image: ${DOCKER_IMAGE_CI_PYTEST_MULTI}
script:
- cd modules/dbnd
- tox -e py39
artifacts:
reports:
junit: build/junit-py39.xml
test dbnd_examples py39:
<<: *template__python_test_job
image: ${DOCKER_IMAGE_CI_PYTEST_MULTI}
script:
- cd examples
- tox -e py39
artifacts:
reports:
junit: .tox/dbnd-examples/junit/junit-py39.xml
#dbnd_databricks_py37:
# <<: *template__python_test_job
# variables:
# KUBERNETES_CPU_REQUEST: 900m
# KUBERNETES_CPU_LIMIT: 2
# KUBERNETES_MEMORY_REQUEST: 2.5Gi
# KUBERNETES_MEMORY_LIMIT: 4Gi
# image: python:3.7
# script:
# - cd plugins/dbnd-databricks
# - tox -e py37
# artifacts:
# reports:
# junit: plugins/dbnd-databricks/build/junit-py37.xml
dbnd_airflow 1_10_15_py37:
<<: *template__python_test_job
image: ${DOCKER_IMAGE_CI_PYTEST_MULTI}
script:
- cd modules/dbnd-airflow
- tox -e py37-airflow_1_10_15
artifacts:
reports:
junit: modules/dbnd-airflow/build/junit-py37-airflow_1_10_15.xml
only: *on_significant_branch
dbnd_monitor py39:
<<: *template__python_test_job
image: ${DOCKER_IMAGE_CI_PYTEST_MULTI}
script:
- cd modules/dbnd-monitor
- tox -e py39
artifacts:
reports:
junit: modules/dbnd-monitor/build/junit-py39.xml
dbnd_airflow_monitor 1_10_10_py37:
<<: *template__python_test_job
image: ${DOCKER_IMAGE_CI_PYTEST_MULTI}
script:
- cd modules/dbnd-airflow-monitor
- tox -e py37-airflow_1_10_10
artifacts:
reports:
junit: modules/dbnd-airflow-monitor/build/junit-py37-airflow_1_10_10.xml
only: *on_significant_branch
when: manual
build_pypi_org_whl:
stage: build-base
needs: ["empty_job"]
script:
- python setup.py sdist bdist_wheel
- make dist-python
artifacts:
paths:
- dist-python/*
only:
- tags
when: manual