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