-
Notifications
You must be signed in to change notification settings - Fork 14
/
.gitlab-ci.yml
121 lines (110 loc) · 3.81 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
stages:
- lint
- tests
- coverage
- pages
flake8:
image: python:3.6
stage: lint
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
cache:
key: "$CI_JOB_NAME"
paths:
- .cache
before_script:
- pip install flake8
script:
- flake8 --count --statistics odoo_rpc_client
.tests-default: &test-default-definition
services:
- name: registry.gitlab.com/katyukha/odoo-ci:10.0
alias: odoo10
- name: registry.crnd.pro/crnd-opensource/docker/odoo-ci-x:11.0-ci
alias: odoo11
- name: registry.crnd.pro/crnd-opensource/docker/odoo-ci-x:12.0-ci
alias: odoo12
- name: registry.crnd.pro/crnd-opensource/docker/odoo-ci-x:13.0-ci
alias: odoo13
- name: registry.crnd.pro/crnd-opensource/docker/odoo-ci-x:14.0-ci
alias: odoo14
- name: registry.crnd.pro/crnd-opensource/docker/odoo-ci-x:15.0-ci
alias: odoo15
variables:
ODOO_TEST_SUPER_PASSWORD: admin
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
cache:
key: "$CI_JOB_NAME"
paths:
- .cache
stage: tests
before_script:
- pip install -r requirements.txt -r requirements-test.txt
script:
- ODOO_TEST_HOST=odoo10 ODOO_TEST_PROTOCOL="xml-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo10 ODOO_TEST_PROTOCOL="json-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo11 ODOO_TEST_PROTOCOL="xml-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo11 ODOO_TEST_PROTOCOL="json-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo12 ODOO_TEST_PROTOCOL="xml-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo12 ODOO_TEST_PROTOCOL="json-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo13 ODOO_TEST_PROTOCOL="xml-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo13 ODOO_TEST_PROTOCOL="json-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo14 ODOO_TEST_PROTOCOL="xml-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo14 ODOO_TEST_PROTOCOL="json-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo15 ODOO_TEST_PROTOCOL="xml-rpc" coverage run -p setup.py test
- ODOO_TEST_HOST=odoo15 ODOO_TEST_PROTOCOL="json-rpc" coverage run -p setup.py test
- coverage combine
- coverage report --fail-under=90
after_script:
- mv .coverage .coverage_${CI_JOB_NAME}
coverage: '/^TOTAL\s+\d+\s+\d+\s+(\d+\%)/'
artifacts:
name: "coverage_${CI_JOB_NAME}"
expire_in: 1 day
paths:
- .coverage_${CI_JOB_NAME}
tests-py2.7:
image: python:2.7
<<: *test-default-definition
tests-py3.5:
image: python:3.5
<<: *test-default-definition
tests-py3.6:
image: python:3.6
<<: *test-default-definition
tests-py3.7:
image: python:3.7
<<: *test-default-definition
tests-py3.8:
image: python:3.8
<<: *test-default-definition
tests-py3.9:
image: python:3.9
<<: *test-default-definition
tests-py3.10:
image: python:3.10
<<: *test-default-definition
coverage:
image: python:3.7
stage: coverage
dependencies:
- tests-py2.7
- tests-py3.5
- tests-py3.6
- tests-py3.7
- tests-py3.8
- tests-py3.9
- tests-py3.10
before_script:
- pip install coverage
script:
- coverage combine .coverage_tests-py2.7 .coverage_tests-py3.5 .coverage_tests-py3.6 .coverage_tests-py3.7 .coverage_tests-py3.8 .coverage_tests-py3.9 .coverage_tests-py3.10
- coverage report --fail-under=90
after_script:
- coverage html
coverage: '/^TOTAL\s+\d+\s+\d+\s+(\d+\%)/'
artifacts:
name: "$CI_JOB_NAME"
expire_in: 14 day
paths:
- htmlcov