-
Notifications
You must be signed in to change notification settings - Fork 19
/
.gitlab-ci.yml
154 lines (142 loc) · 3.54 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
image: hatsoftwares/lutim-test-ci:latest
stages:
- create_release
- pouet_it
- podcheck
- carton
- carton_bdd
- tests
- cover
before_script:
- rm -f *.db
variables:
POSTGRES_DB: lutim_db
POSTGRES_USER: lutim
POSTGRES_PASSWORD: lutim_pwd
### Jobs templates
##
#
.retry: &retry
retry: 2
except:
- tags
.carton_bdd_template: &carton_bdd_definition
<<: *retry
stage: carton_bdd
artifacts:
paths:
- local/
needs:
- carton
.test_template: &test_definition
<<: *retry
stage: tests
script:
- MOJO_CONFIG=t/$CI_JOB_NAME.conf make test
- MOJO_CONFIG=t/$CI_JOB_NAME.conf make watch
- MOJO_CONFIG=t/$CI_JOB_NAME.conf make cleanbdd
- MOJO_CONFIG=t/$CI_JOB_NAME.conf make cleanfiles
- MOJO_CONFIG=t/$CI_JOB_NAME.conf make stats
- MOJO_CONFIG=t/$CI_JOB_NAME.conf make test-junit-output
artifacts:
paths:
- tap.xml
- cover_db/
.sqlite_template: &sqlite_definition
<<: *test_definition
needs:
- carton_sqlite
.pg_template: &pg_definition
<<: *test_definition
needs:
- carton_postgresql
services:
- name: postgres:9.6
alias: postgres
### Publish tag changelog and create a toot
##
#
include:
- 'https://framagit.org/fiat-tux/gitlabci-snippets/-/raw/2aac6c1f3dd725d9aed57549da67a92759f9f9ec/create-release-from-ci.gitlab-ci.yml'
- 'https://framagit.org/fiat-tux/gitlabci-snippets/-/raw/41345a919d3c927991782f5fd17e0c7b338a3f3a/pouet-it-from-ci.gitlab-ci.yml'
### Podcheck
##
#
podcheck:
<<: *retry
stage: podcheck
script:
- make podcheck
### Install common dependencies
##
#
carton:
<<: *retry
stage: carton
artifacts:
paths:
- local/
dependencies: []
script:
- cpanm -l local Devel::Cover~1.29
- carton install --deployment --without=sqlite --without=postgresql --without=minion --without=cache --without=memcached
when: always
### Install DB related dependencies
##
#
carton_sqlite:
<<: *carton_bdd_definition
script:
- carton install --deployment --without=postgresql --without=minion --without=cache --without=memcached
carton_postgresql:
<<: *carton_bdd_definition
script:
- carton install --deployment --without=sqlite --without=minion --without=cache --without=memcached
### SQLite tests
##
#
sqlite1:
<<: *sqlite_definition
before_script:
- carton install --deployment --without=postgresql --without=minion --without=cache --without=memcached
sqlite2:
<<: *sqlite_definition
before_script:
- carton install --deployment --without=postgresql --without=cache --without=memcached
sqlite3:
<<: *sqlite_definition
services:
- name: postgres:9.6
alias: postgres
before_script:
- carton install --deployment --without=cache --without=memcached
- export PGPASSWORD=lutim_pwd; echo 'CREATE DATABASE lutim_minion WITH OWNER lutim;' | psql -h postgres -U lutim lutim_db
### PostgreSQL tests
##
#
postgresql1:
<<: *pg_definition
before_script:
- carton install --deployment --without=sqlite --without=minion --without=cache --without=memcached
postgresql2:
<<: *pg_definition
before_script:
- carton install --deployment --without=cache --without=memcached
postgresql3:
<<: *pg_definition
before_script:
- carton install --deployment --without=sqlite --without=cache --without=memcached
- export PGPASSWORD=lutim_pwd; echo 'CREATE DATABASE lutim_minion WITH OWNER lutim;' | psql -h postgres -U lutim lutim_db
### Code coverage
##
#
cover:
stage: cover
script:
- make cover
coverage: '/Total.* (\d+\.\d+)$/'
artifacts:
reports:
junit: tap.xml
except:
- tags