gitlab-ci: enable neo4j
[nit.git] / .gitlab-ci.yml
1 image: nitlang/nit-ci
2
3 services:
4   - mongo
5   - neo4j:2.3
6   - postgres
7
8 variables:
9   NEO4J_AUTH: none
10
11 cache:
12   paths:
13     - .ccache
14   key: "$CI_JOB_NAME"
15
16 stages:
17   - build
18   - test
19   - more_test
20   - deploy
21
22 before_script:
23   - date
24   - export CCACHE_DIR=$PWD/.ccache
25   - export PATH=$PWD/bin:$PATH
26   - pwd
27   - ccache -s
28   - ccache -M 500M
29   - type -a nitc nitdoc || true # is there some nit tools?
30   - "> status.txt"
31
32 after_script:
33   - export CCACHE_DIR=$PWD/.ccache
34   - ccache -s
35   - git status --ignored
36   - date
37   - tail status.txt
38
39 # BASIC JOBS ########################################################
40
41 sanity_checks:
42   stage: build
43   script:
44     - misc/jenkins/checkwhitespaces.sh | tee -a status.txt
45     - misc/jenkins/checksignedoffby.sh | tee -a status.txt
46     - misc/jenkins/checklicense.sh | tee -a status.txt
47
48 build_tools:
49   stage: build
50   script:
51     - make 2>> status.txt
52     - nitc --version
53     - misc/jenkins/check_manpages.sh
54     - "{ cd tests && ./tests.sh base_sim*.nit ../src/nitlight.nit; }"
55     - nitunit -v lib/core
56   artifacts:
57     paths:
58       - bin/*
59       - c_src/nitc
60       - src/version.nit
61       - src/nitc_0
62       - nitunit.xml*
63       - tests/*.xml*
64     when: always
65     reports:
66       junit:
67         - tests/*.xml
68         - nitunit.xml
69
70 test_some:
71   stage: test
72   dependencies:
73     - build_tools
74   script:
75     - cd tests
76     - ./search_tests_git.sh origin/master HEAD > list
77     - ./testall.sh `cat list` | tee log.txt
78     - grep -v '=>' log.txt > ../status.txt || true
79   artifacts:
80     paths:
81       - tests/errlist
82       - tests/*.xml
83     when: always
84     reports:
85       junit: tests/*.xml
86
87 nitunit_some:
88   stage: test
89   dependencies:
90     - build_tools
91   script:
92     - git diff --name-only origin/master..HEAD -- "*.nit" "*.res" "README.*" | grep -v "^tests/" > list0.txt
93     - xargs nitls -pP < list0.txt > list.txt
94     - xargs nitunit < list.txt
95   artifacts:
96     paths:
97       - nitunit.xml*
98     when: always
99     reports:
100       junit:
101         - nitunit.xml
102
103 nitpick_full:
104   stage: test
105   dependencies:
106     - build_tools
107   script:
108     - nitls lib src examples contrib
109     - nitls -Pp lib src examples | grep -v -f tests/gitlab_ci.skip > list.txt # filter what is skipped by tests.sh
110     - xargs nitpick < list.txt
111
112 # TEST FULL #########################################################
113
114 test_full_nitcs:
115   stage: more_test
116   dependencies:
117     - build_tools
118   script:
119     - cd tests
120     - ./testfull.sh | tee log.txt
121     - grep -v '=>' log.txt > ../status.txt || true
122   artifacts:
123     paths:
124       - tests/errlist
125       - tests/*.xml*
126       - tests/out/*.res
127       - tests/out/*.log
128     when: always
129     reports:
130       junit: tests/*.xml
131
132 test_full_niti:
133   stage: more_test
134   dependencies:
135     - build_tools
136   script:
137     - cd tests
138     - ./testfull.sh --engine niti | tee log.txt
139     - grep -v '=>' log.txt > ../status.txt || true
140   artifacts:
141     paths:
142       - tests/errlist
143       - tests/*.xml*
144       - tests/out/*.res
145       - tests/out/*.log
146     when: always
147     reports:
148       junit: tests/*.xml
149
150 test_full_nitcg:
151   stage: more_test
152   dependencies:
153     - build_tools
154   script:
155     - cd tests
156     - ./testfull.sh --engine nitcg | tee log.txt
157     - grep -v '=>' log.txt > ../status.txt || true
158   artifacts:
159     paths:
160       - tests/errlist
161       - tests/*.xml*
162       - tests/out/*.res
163       - tests/out/*.log
164     when: always
165     reports:
166       junit: tests/*.xml
167
168 test_full_nitce:
169   stage: more_test
170   dependencies:
171     - build_tools
172   script:
173     - cd tests
174     - ./testfull.sh --engine nitce | tee log.txt
175     - grep -v '=>' log.txt > ../status.txt || true
176   artifacts:
177     paths:
178       - tests/errlist
179       - tests/*.xml*
180       - tests/out/*.res
181       - tests/out/*.log
182     when: always
183     reports:
184       junit: tests/*.xml
185
186 test_full_nitcsg:
187   stage: more_test
188   dependencies:
189     - build_tools
190   script:
191     - cd tests
192     - ./testfull.sh --engine nitcsg | tee log.txt
193     - grep -v '=>' log.txt > ../status.txt || true
194   artifacts:
195     paths:
196       - tests/errlist
197       - tests/*.xml*
198       - tests/out/*.res
199       - tests/out/*.log
200     when: always
201     reports:
202       junit: tests/*.xml
203
204 # LIB, CONTRIB AND OOT ##############################################
205
206 nitunit_lib:
207   stage: more_test
208   dependencies:
209     - build_tools
210   script:
211     - nitls -Pp lib | grep -v -f tests/gitlab_ci.skip > list.txt # filter what is skipped by tests.sh
212     - xargs nitunit -v < list.txt| tee log.txt
213     - grep -e KO log.txt > status.txt || true
214     - tail -3 log.txt >> status.txt
215   artifacts:
216     paths:
217       - nitunit.xml*
218     when: always
219     reports:
220       junit:
221         - nitunit.xml
222
223 nitunit_src:
224   stage: more_test
225   dependencies:
226     - build_tools
227   script:
228     - nitls -Pp src examples | grep -v -f tests/gitlab_ci.skip > list.txt # filter what is skipped by tests.sh
229     - xargs nitunit -v < list.txt| tee log.txt
230     - grep -e KO log.txt > status.txt || true
231     - tail -3 log.txt >> status.txt
232   artifacts:
233     paths:
234       - nitunit.xml*
235     when: always
236     reports:
237       junit:
238         - nitunit.xml
239
240 test_contribs:
241   stage: more_test
242   dependencies:
243     - build_tools
244   script:
245     - misc/jenkins/check_contrib.sh all check
246     - grep 'error message' *.xml > status.txt || true
247     - test ! -s status.txt # no lines, no errors
248   allow_failure: true
249
250 build_oot:
251   stage: more_test
252   dependencies:
253     - build_more_tools
254   script:
255     - cd contrib
256     - ./oot.sh all
257     - grep 'error message' *.xml > ../status.txt || true
258     - test ! -s ../status.txt # no lines, no errors
259   allow_failure: true
260
261 # MISC ##############################################################
262
263 bootstrap_full:
264   stage: more_test
265   dependencies:
266     - build_tools
267   script:
268     - cd src
269     - ./full_bootstrap
270     - ./ncall.sh
271
272 bench_fast:
273   stage: more_test
274   dependencies:
275     - build_tools
276   script:
277     - cd benchmarks
278     - ./bench_engines.sh --fast --fast --html options
279     - grep -B1 'error message' *.xml | grep testcase > ../status.txt || true
280   artifacts:
281     paths:
282       - benchmarks/*.html
283       - benchmarks/*.png
284       - benchmarks/*.dat
285       - benchmarks/*.gnu
286     when: always
287   allow_failure: true
288
289
290 # MORE TOOLS ########################################################
291
292 build_more_tools:
293   stage: test
294   dependencies:
295     - build_tools
296   script:
297     - make more
298     - make -C "contrib/nitcc"
299   artifacts:
300     paths:
301       - bin/*
302       - c_src/nitc
303       - src/version.nit
304       - src/nitc_0
305
306 build_doc:
307   stage: more_test
308   dependencies:
309     - build_more_tools
310   script:
311     - nitls -r -t .
312     - nitdoc -d nitdoc.out --keep-going lib src
313   artifacts:
314     paths:
315       - nitdoc.out
316
317 build_catalog:
318   stage: more_test
319   dependencies:
320     - build_more_tools
321   script:
322     - misc/jenkins/check_contrib.sh pre-build
323     - cd contrib
324     - ./oot.sh update
325     - ./oot.sh pre-build
326     - cd ..
327     - nitcatalog -d catalog.out lib/ examples/ contrib/ contrib/oot/
328   dependencies:
329     - build_more_tools
330   artifacts:
331     paths:
332       - catalog.out
333
334 .test_macos:
335   script:
336     - uname
337     - pwd
338     - ls /
339   stage: build
340   tags:
341     - macos