gitlab: remove the android gst-build target
[platform/upstream/gstreamer.git] / gitlab / ci_template.yml
1 stages:
2   - 'preparation'
3   # Test just one basic build, if it succeeds proceed to test the rest
4   - 'build'
5   - 'test'
6   # Run multiple builds and tests, multi-distro, multi-arch
7   - 'full builds'
8   - 'full tests'
9
10 variables:
11   CERBERO_IMAGE: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/cerbero-fedora:fb5e6c259536f2733ac2901f04fffffb35c510b5'
12   FEDORA_IMAGE: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/fedora:b8c24cc7f4cfb19813a324cbbb65c5e89b55eebc'
13   INDENT_IMAGE: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/gst-indent:6f7e01e1e30a73efa880acdc8e911f1f20c58dbb'
14   MANIFEST_IMAGE: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/build-manifest:d19082b72667fb3382bdc3621520c4d26e258b2e'
15
16   GIT_STRATEGY: none
17   DEFAULT_MESON_ARGS: >
18     --werror
19     -Dpython=enabled
20     -Dlibav=enabled
21     -Dugly=enabled
22     -Dbad=enabled
23     -Ddevtools=enabled
24     -Dges=enabled
25     -Drtsp_server=enabled
26     -Dvaapi=enabled
27     -Dsharp=disabled
28
29   DEFAULT_CERBERO_ARGS: >
30      --variants werror
31
32 manifest:
33   image: $MANIFEST_IMAGE
34   stage: 'preparation'
35   script:
36     - cd /gst-ci
37     - gitlab/build_manifest.py --self-update
38     - gitlab/build_manifest.py ${CI_PROJECT_DIR}/manifest.xml
39     - cat ${CI_PROJECT_DIR}/manifest.xml
40   artifacts:
41     expire_in: "7 days"
42     paths:
43       - "manifest.xml"
44
45 gst indent:
46   image: $INDENT_IMAGE
47   stage: 'preparation'
48   variables:
49     GIT_STRATEGY: 'fetch'
50   script:
51     # man indent. grep RETURN VALUE, grab a beer on my behalf...
52     - indent --version || true
53     - curl -o gst-indent https://gitlab.freedesktop.org/gstreamer/gstreamer/raw/master/tools/gst-indent
54     - chmod +x gst-indent
55     - find . -name '*.c' -exec ./gst-indent {} +
56     - |
57       if git diff --quiet; then
58           echo "Code is properly formatted"
59       else
60           git diff --color=always
61           echo 'style diverges, please run gst-indent first'
62           exit 1
63       fi
64   except:
65     variables:
66       # No point on trying to format C files in those repositories
67       - $CI_PROJECT_NAME == "gstreamer-sharp"
68       - $CI_PROJECT_NAME == "cerbero"
69
70 .build:
71   stage: 'full builds'
72   dependencies:
73     - "manifest"
74   variables:
75     CC: "ccache gcc"
76     CXX: "ccache g++"
77     CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
78     CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"
79     MAIN_DIR: "${CI_PROJECT_DIR}/validate-output/"
80     MESON_ARGS: "${DEFAULT_MESON_ARGS}"
81
82   script:
83     - ccache -z
84     # Not sure why, but permission errors else
85     # https://gitlab.freedesktop.org/alatiera/gstreamer/-/jobs/41441
86     - cp -r /gst-build/ . && cd gst-build
87     - ./git-update --no-interaction --manifest="${CI_PROJECT_DIR}/manifest.xml"
88     - meson build/ $MESON_ARGS
89     - ninja -C build/
90     - ccache -s
91   after_script:
92     - cd gst-build/
93     # Clean the artifacts packages to avoid copying "useless" build products.
94     - test -d build && find build -name '*.[ao]' -delete
95     # Clean the .git repos since we won't need them anymore
96     - rm -rf subprojects/*/.git/
97     - rm -rf build/subprojects/*/.git/
98   cache:
99     key: "${CI_JOB_NAME}"
100     paths:
101       - "${CCACHE_DIR}"
102   artifacts:
103     expire_in: '5 days'
104     when: always
105     paths:
106       - "manifest.xml"
107       - "gst-build/"
108   except:
109     variables:
110       - $CI_PROJECT_NAME == "cerbero"
111
112 build fedora x86_64:
113   extends: '.build'
114   stage: 'build'
115   image: $FEDORA_IMAGE
116   variables:
117     MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled"
118
119 .test:
120   stage: 'test'
121   variables:
122     MAIN_DIR: "${CI_PROJECT_DIR}/validate-output/"
123     # Disable colored output to avoid weird rendering issues
124     GST_DEBUG_COLOR: 'no'
125
126     # note the -b at the start of each line
127     # Can't comment inline sadly
128     # FIXME: get this into gst-validate-launcher KNOWN_ISSUES
129     # gstreamer.pipelines_parse_launch.delayed_link: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/345
130     # gstreamer.gst_gstsystemclock.test_async_sync_interaction: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/346
131     # gstreamer.gst_gstsystemclock.test_periodic_multi: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/347
132     # gstreamer.gst_gstsystemclock.test_periodic_shot: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/348
133     # elements_multisocketsink.test_sending_buffers_with_9_gstmemories: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/525
134     # elements_multisocketsink.test_client_next_keyframe: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/516
135     # flvmux.test_incrementing_timestamps: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/530
136     # flvmux.test_video_caps_late: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/543
137     # rtpbin.test_sender_eos: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/527
138     # rtpbin.test_cleanup_recv: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/546
139     # souphttpsrc.test_icy_stream: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/307
140     # rtspserver.test_shared_udp: https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/issues/61
141     # rtpsession.test_multiple_senders_roundrobin_rbs: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/548
142     # dtls: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/811
143     # mpegtsmux.test_align: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/844
144     # shm.test_shm_live: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/847
145     # splitmux.test_splitmuxsink_async: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/531
146     # splitmux.test_splitmuxsrc_caps_change: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/547
147     # splitmux.test_splitmuxsrc_sparse_streams: https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/544
148     # netsim.netsim_stress: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/849
149     # nle_complex.test_one_expandable_another: https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/55
150     # nle_simple.test_simplest: https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/57
151     # ges_basic.test_ges_pipeline_change_state: https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/58
152     # gst-editing-services.pythontests.pyunittest.python.test_timeline.TestTransitions.test_transition_type: https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/62
153     # gst-editing-services.pythontests.pyunittest.python.test_timeline.TestTransitions.test_auto_transition: https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/63
154     # pipelines_tcp.test_that_tcpserversink_and_tcpclientsrc_are_symmetrical: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/221
155     # elements_capsfilter.test_unfixed_downstream_caps: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/335
156     # gst_rtspclientsink.test_record: https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/issues/55
157     # elements_audiotestsrc.test_layout: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/535
158     # camerabin.test_image_video_cycle: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/864
159     # camerabin.test_single_video_recording: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/864#note_101558
160     # camerabin.test_multiple_video_recordings: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/864#note_101646
161     # audiomixer.test_flush_start_flush_stop: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/555
162     # check.gstreamer-sharp.SdpTests: https://gitlab.freedesktop.org/gstreamer/gstreamer-sharp/issues/17
163     #
164     # TO FURTHER INVESTIGATE:
165     # check.gst-plugins-base.libs_gstglcolorconvert.test_reorder_buffer
166     # check.gstreamer.gst_gstelement.test_foreach_pad
167     # check.gstreamer.libs_baseparse.parser_pull_short_read
168     # check.gstreamer.pipelines_seek.test_loopback_2
169     # check.gst-plugins-base.elements_appsrc.test_appsrc_blocked_on_caps
170     BLACKLIST: >
171       -b check.gstreamer.pipelines_parse_launch.delayed_link
172       -b check.gstreamer.gst_gstsystemclock.test_async_sync_interaction
173       -b check.gstreamer.gst_gstsystemclock.test_periodic_multi
174       -b check.gstreamer.gst_gstsystemclock.test_periodic_shot
175       -b check.gstreamer.pipelines_seek.test_loopback_2
176       -b check.gstreamer.gst_gstelement.test_foreach_pad
177       -b check.gstreamer.libs_baseparse.parser_pull_short_read
178       -b check.gst-plugins-base.elements_multisocketsink.test_sending_buffers_with_9_gstmemories
179       -b check.gst-plugins-base.elements_multisocketsink.test_client_next_keyframe
180       -b check.gst-plugins-base.elements_multisocketsink.test_add_client
181       -b check.gst-plugins-base.libs_gstglcolorconvert.test_reorder_buffer
182       -b check.gst-plugins-base.elements_audiotestsrc.test_layout
183       -b check.gst-plugins-good.elements_souphttpsrc.test_icy_stream
184       -b check.gst-plugins-good.elements_rtpbin.test_sender_eos
185       -b check.gst-plugins-good.elements_rtpbin.test_cleanup_recv
186       -b check.gst-plugins-good.elements_flvmux.test_incrementing_timestamps
187       -b check.gst-plugins-good.elements_flvmux.test_video_caps_late
188       -b check.gst-plugins-base.elements_appsrc.test_appsrc_blocked_on_caps
189       -b check.gst-plugins-good.elements_splitmux.test_splitmuxsrc_sparse_streams
190       -b check.gst-plugins-good.elements_splitmux.test_splitmuxsrc_caps_change
191       -b check.gst-plugins-bad.elements_dtls.test_data_transfer
192       -b check.gst-plugins-bad.elements_dtls.test_create_and_unref
193       -b check.gst-plugins-bad.elements_camerabin.test_image_video_cycle
194       -b check.gst-plugins-bad.elements_camerabin.test_single_video_recording
195       -b check.gst-plugins-bad.elements_camerabin.test_multiple_video_recordings
196       -b check.gst-plugins-good.elements_rtpsession.test_multiple_senders_roundrobin_rbs
197       -b check.gst-plugins-bad.elements_shm.test_shm_live
198       -b check.gst-plugins-good.elements_splitmux.test_splitmuxsink_async
199       -b check.gst-plugins-bad.elements_netsim.netsim_stress
200       -b check.gst-editing-services.nle_complex.test_one_expandable_another
201       -b check.gst-editing-services.nle_simple.test_simplest
202       -b check.gst-editing-services.ges_basic.test_ges_pipeline_change_state
203       -b check.gst-editing-services.pythontests.pyunittest.python.test_timeline.TestTransitions.test_transition_type
204       -b check.gst-editing-services.pythontests.pyunittest.python.test_timeline.TestTransitions.test_auto_transition
205       -b check.gst-plugins-base.pipelines_tcp.test_that_tcpserversink_and_tcpclientsrc_are_symmetrical
206       -b check.gstreamer.elements_capsfilter.test_unfixed_downstream_caps
207       -b check.gst-rtsp-server.gst_rtspclientsink.test_record
208       -b check.gst-rtsp-server.gst_rtspserver.test_shared_udp
209       -b check.gst-plugins-base.elements_audiomixer.test_flush_start_flush_stop
210       -b check.gstreamer-sharp.SdpTests
211   script:
212     - cd gst-build/
213     - >
214       ./gst-uninstalled.py
215       gst-validate-launcher ${TEST_SUITE}
216       -fs
217       --mute
218       --shuffle
219       --no-display
220       --dump-on-failure
221       --meson-no-rebuild
222       -M "${CI_PROJECT_DIR}/validate-output/"
223       --xunit-file "${CI_PROJECT_DIR}/validate-output/logs/xunit.xml"
224       ${BLACKLIST}
225   artifacts:
226     expire_in: '14 days'
227     when: always
228     paths:
229       - 'gst-build/build/meson-logs/'
230       - 'validate-output/logs'
231     reports:
232       junit:
233         - "validate-output/logs/*.xml"
234   # We disable the .build above, which this job usually depends upon for cerbero
235   except:
236     variables:
237       - $CI_PROJECT_NAME == "cerbero"
238
239 .test fedora x86_64:
240   image: $FEDORA_IMAGE
241   extends: '.test'
242   dependencies:
243     - build fedora x86_64
244
245 check fedora:
246   extends: '.test fedora x86_64'
247   variables:
248     TEST_SUITE: "check.gst*"
249
250 # Template for Cerbero GStreamer Build
251 #
252 # Parameters:
253 # CONFIG: The name of the configuration file to use
254 #
255 # Produces runtime and devel tarball packages.
256 .cerbero:
257   stage: "full builds"
258   image: $CERBERO_IMAGE
259   dependencies:
260     - "manifest"
261   variables:
262     CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
263     CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"
264     CCACHE_MAXSIZE: "1.7G"
265     CERBERO_HOME: "${CI_PROJECT_DIR}/cerbero-build"
266     CERBERO_SOURCES: "${CI_PROJECT_DIR}/cerbero-sources"
267     CERBERO_DEPS: "cerbero-deps.tar.gz"
268     CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS}"
269     CERBERO: "./cerbero-uninstalled -c config/${CONFIG} -c localconf.cbc -m manifest.xml"
270   before_script:
271     # FIXME Wrong namespace
272     # Workaround build-tools having hardcoded internal path
273     - mkdir -p /builds/gstreamer
274     - ln -sf ${CI_PROJECT_DIR} /builds/gstreamer/cerbero
275     - rsync -aH /cerbero/ .
276     - test -f ${CERBERO_DEPS} && tar -C ${CERBERO_HOME} -xf ${CERBERO_DEPS}
277     - echo "home_dir = \"${CERBERO_HOME}\"" >> localconf.cbc
278     - echo "local_sources = \"${CERBERO_SOURCES}\"" >> localconf.cbc
279     - ./cerbero-uninstalled --self-update manifest.xml
280     - ccache -z
281   script:
282     - $CERBERO $CERBERO_ARGS show-config
283     - $CERBERO $CERBERO_ARGS fetch-bootstrap --build-tools-only
284     - $CERBERO $CERBERO_ARGS fetch-package --deps gstreamer-1.0
285     - $CERBERO $CERBERO_ARGS fetch-cache
286     - $CERBERO $CERBERO_ARGS bootstrap --offline --build-tools-only
287     - $CERBERO $CERBERO_ARGS package --offline -t -o ${CI_PROJECT_DIR} gstreamer-1.0
288     - ccache -s
289   except:
290     variables:
291       - $CI_PROJECT_NAME == "gst-build"
292   cache:
293     key: "${CI_JOB_NAME}"
294     paths:
295       - "${CCACHE_DIR}"
296       - "${CERBERO_SOURCES}"
297   artifacts:
298     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
299     expire_in: '5 days'
300     when: 'always'
301     paths:
302       - "manifest.xml"
303       - "cerbero-build/logs"
304       - "*.tar.bz2"
305
306 # Template for Cerbero GStreamer Deps
307 #
308 # This template is used by cerbero/ project to pre-built the GStreamer
309 # depedencies. When available, the .cerbero jobs will download this artifact
310 # in order to speed up the build.
311 #
312 # Parameters:
313 # CONFIG: The name of the configuration file to use
314 # ARCH: The cerbero <os>_<cpu> (used in cache key)
315 #
316 # Produce an artifact with the dist/ and .cache along
317 # with the associated build-tools.
318 .cerbero deps:
319   extends: .cerbero
320   stage: "build"
321   script:
322     - $CERBERO $CERBERO_ARGS show-config
323     - $CERBERO $CERBERO_ARGS fetch-bootstrap --build-tools-only
324     - $CERBERO $CERBERO_ARGS fetch-package --deps gstreamer-1.0
325     - $CERBERO $CERBERO_ARGS bootstrap --offline --build-tools-only
326     - $CERBERO $CERBERO_ARGS build-deps --offline
327           gstreamer-1.0 gst-plugins-base-1.0 gst-plugins-good-1.0
328           gst-plugins-bad-1.0 gst-plugins-ugly-1.0 gst-rtsp-server-1.0
329           gst-libav-1.0 gst-validate gst-editing-services-1.0 libnice
330     - $CERBERO $CERBERO_ARGS fetch-cache --skip-fetch --job-id=${CI_JOB_ID}
331     - tar -C ${CERBERO_HOME} -czf $CERBERO_DEPS
332               build-tools build-tools.cache
333               dist/${ARCH} ${ARCH}.cache
334     - ccache -s
335   only:
336     variables:
337       - $CI_PROJECT_NAME == "cerbero"
338   artifacts:
339     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
340     expire_in: '10 days'
341     when: 'always'
342     paths:
343       - "manifest.xml"
344       - "cerbero-build/logs"
345       - "cerbero-build/cerbero-deps.log"
346       - "${CERBERO_DEPS}"
347
348 #
349 # Cerbero Linux X86_64 build
350 #
351 cerbero deps fedora x86_64:
352   extends: '.cerbero deps'
353   variables:
354     CONFIG: "linux.config"
355     ARCH: "linux_x86_64"
356
357 .cerbero fedora x86_64:
358   extends: '.cerbero'
359   variables:
360     CONFIG: "linux.config"
361
362 cerbero fedora x86_64:
363   extends: '.cerbero fedora x86_64'
364   dependencies:
365     - "cerbero deps fedora x86_64"
366   only:
367     variables:
368       - $CI_PROJECT_NAME == "cerbero"
369
370 build cerbero fedora x86_64:
371   extends: '.cerbero fedora x86_64'
372   except:
373     variables:
374       - $CI_PROJECT_NAME == "cerbero"
375
376
377 #
378 # Cerbero Android Universal build
379 #
380 cerbero deps android universal:
381   extends: '.cerbero deps'
382   variables:
383     CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS} -v nowerror"
384     CONFIG: "cross-android-universal.cbc"
385     ARCH: "android_universal"
386
387 .cerbero android universal:
388   extends: '.cerbero'
389   variables:
390     CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS} -v nowerror"
391     CONFIG: "cross-android-universal.cbc"
392
393 cerbero android universal:
394   extends: '.cerbero android universal'
395   dependencies:
396     - "cerbero deps android universal"
397   only:
398     variables:
399       - $CI_PROJECT_NAME == "cerbero"
400
401 build cerbero android universal:
402   extends: '.cerbero android universal'
403   except:
404     variables:
405       - $CI_PROJECT_NAME == "cerbero"
406
407 #
408 # Cerbero Cross Windows builds
409 #
410 cerbero deps windows x86:
411   extends: '.cerbero deps'
412   variables:
413     CONFIG: "cross-win32.cbc"
414     ARCH: "windows_x86"
415
416 .cerbero cross win32:
417   extends: '.cerbero'
418   variables:
419     CONFIG: "cross-win32.cbc"
420
421 cerbero cross win32:
422   extends: '.cerbero cross win32'
423   dependencies:
424     - "cerbero deps windows x86"
425   only:
426     variables:
427       - $CI_PROJECT_NAME == "cerbero"
428
429 build cerbero cross win32:
430   extends: '.cerbero cross win32'
431   except:
432     variables:
433       - $CI_PROJECT_NAME == "cerbero"
434
435 cerbero deps windows x86_64:
436   extends: '.cerbero deps'
437   variables:
438     CONFIG: "cross-win64.cbc"
439     ARCH: "windows_x86_64"
440
441 .cerbero cross win64:
442   extends: '.cerbero'
443   variables:
444     CONFIG: "cross-win64.cbc"
445
446 cerbero cross win64:
447   extends: '.cerbero cross win64'
448   dependencies:
449     - "cerbero deps windows x86_64"
450   only:
451     variables:
452       - $CI_PROJECT_NAME == "cerbero"
453
454 build cerbero cross win64:
455   extends: '.cerbero cross win64'
456   except:
457     variables:
458       - $CI_PROJECT_NAME == "cerbero"