-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
171 lines (164 loc) · 4.2 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
image: hatsoftwares/lstu-test-ci:latest
stages:
- podcheck
- carton
- carton_bdd
- tests
before_script:
- rm -f *db
variables:
POSTGRES_DB: lstu_db
POSTGRES_USER: lstu
POSTGRES_PASSWORD: lstu_pwd
MYSQL_DATABASE: lstu_db
MYSQL_USER: lstu
MYSQL_PASSWORD: lstu_pwd
MYSQL_ROOT_PASSWORD: root
### Jobs templates
##
#
.carton_bdd_template: &carton_bdd_definition
stage: carton_bdd
retry: 2
artifacts:
paths:
- local/
dependencies:
- carton
.sqlite_template: &sqlite_definition
stage: tests
retry: 2
dependencies:
- carton_sqlite
services:
- name: rroemhild/test-openldap
alias: rroemhild-test-openldap
coverage: '/Total .*(\d+\.\d+)$/'
.pg_template: &pg_definition
stage: tests
retry: 2
dependencies:
- carton_postgresql
services:
- name: postgres:9.6
alias: postgres
- name: rroemhild/test-openldap
alias: rroemhild-test-openldap
coverage: '/Total .*(\d+\.\d+)$/'
.mysql_template: &mysql_definition
stage: tests
retry: 2
dependencies:
- carton_mysql
services:
- name: mariadb:10.1
alias: mariadb
- name: rroemhild/test-openldap
alias: rroemhild-test-openldap
coverage: '/Total .*(\d+\.\d+)$/'
### Podcheck
##
#
podcheck:
stage: podcheck
script:
- make podcheck
### Install common dependencies
##
#
carton:
stage: carton
artifacts:
paths:
- local/
dependencies: []
script:
- carton install --deployment --without=sqlite --without=postgresql --without=mysql
when: always
retry: 2
### Install DB related dependencies
##
#
carton_sqlite:
<<: *carton_bdd_definition
script:
- carton install --deployment --without=postgresql --without=mysql
carton_postgresql:
<<: *carton_bdd_definition
script:
- carton install --deployment --without=sqlite --without=mysql
carton_mysql:
<<: *carton_bdd_definition
script:
- carton install --deployment --without=sqlite --without=postgresql
### SQLite tests
##
#
sqlite1:
<<: *sqlite_definition
script:
- carton install --deployment --without=postgresql --without=mysql
- MOJO_CONFIG=t/sqlite1.conf make test
- MOJO_CONFIG=t/sqlite1.conf make cover
sqlite2:
<<: *sqlite_definition
script:
- carton install --deployment --without=postgresql --without=mysql
- MOJO_CONFIG=t/sqlite2.conf make test
- MOJO_CONFIG=t/sqlite2.conf make cover
sqlite3:
<<: *sqlite_definition
script:
- carton install --deployment --without=postgresql --without=mysql
- MOJO_CONFIG=t/sqlite3.conf make minion &
- sleep 5
- MOJO_CONFIG=t/sqlite3.conf make test
- MOJO_CONFIG=t/sqlite3.conf make cover
### PostgreSQL tests
##
#
postgresql1:
<<: *pg_definition
script:
- carton install --deployment --without=sqlite --without=mysql
- MOJO_CONFIG=t/postgresql1.conf make test
- MOJO_CONFIG=t/postgresql1.conf make cover
postgresql2:
<<: *pg_definition
script:
- carton install --deployment --without=sqlite --without=mysql
- MOJO_CONFIG=t/postgresql2.conf make test
- MOJO_CONFIG=t/postgresql2.conf make cover
postgresql3:
<<: *pg_definition
script:
- carton install --deployment --without=sqlite --without=mysql
- export PGPASSWORD=lstu_pwd; echo 'CREATE DATABASE lstu_minion WITH OWNER lstu;' | psql -h postgres -U lstu lstu_db
- MOJO_CONFIG=t/postgresql3.conf make minion &
- sleep 5
- MOJO_CONFIG=t/postgresql3.conf make test
- MOJO_CONFIG=t/postgresql3.conf make cover
### MySQL tests
##
#
mysql1:
<<: *mysql_definition
script:
- carton install --deployment --without=sqlite --without=postgresql
- MOJO_CONFIG=t/mysql1.conf make test
- MOJO_CONFIG=t/mysql1.conf make cover
mysql2:
<<: *mysql_definition
script:
- carton install --deployment --without=sqlite --without=postgresql
- MOJO_CONFIG=t/mysql2.conf make test
- MOJO_CONFIG=t/mysql2.conf make cover
mysql3:
<<: *mysql_definition
script:
- carton install --deployment --without=sqlite --without=postgresql
- echo "CREATE DATABASE lstu_minion; GRANT ALL ON lstu_minion.* TO lstu@'%'; FLUSH PRIVILEGES;" | mysql -h mariadb -u root -proot
- MOJO_CONFIG=t/mysql3.conf make minion &
- sleep 5
- MOJO_CONFIG=t/mysql3.conf make test
- MOJO_CONFIG=t/mysql3.conf make cover