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