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