638f73f8caaccb0af04b2106d73769c70b7a0b64
[platform/upstream/gstreamer.git] / .gitlab-ci.yml
1 include:
2   - project: 'freedesktop/ci-templates'
3     ref: 14731f78c23c7b523a85a26a068ade9ac1ecd2f3
4     file: '/templates/fedora.yml'
5   - project: 'freedesktop/ci-templates'
6     ref: 14731f78c23c7b523a85a26a068ade9ac1ecd2f3
7     file: '/templates/debian.yml'
8   ###
9   # IMPORTANT
10   # These are the version tags for the docker images the CI runs against.
11   # If you are hacking on them or need a them to rebuild, you need to change
12   # the appropriate version string in this file which will cause a rebuild.
13   ###
14   - local: '.gitlab-image-tags.yml'
15
16 stages:
17   - 'preparation'
18   - 'build'
19   - 'test'
20   # Use the resulting binaries
21   - 'integrate'
22
23 variables:
24   GIT_DEPTH: 1
25
26   # Branch to track for modules that have no ref specified in the manifest
27   GST_UPSTREAM_BRANCH: 'main'
28
29   FDO_UPSTREAM_REPO: 'gstreamer/gstreamer'
30
31   FEDORA_AMD64_SUFFIX: 'amd64/fedora'
32   INDENT_AMD64_SUFFIX: 'amd64/gst-indent'
33   WINDOWS_AMD64_SUFFIX: 'amd64/windows'
34
35   WINDOWS_IMAGE: "$CI_REGISTRY_IMAGE/$WINDOWS_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH"
36   WINDOWS_UPSTREAM_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/$WINDOWS_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH"
37
38   MESON_BUILDTYPE_ARGS: --default-library=both
39   DEFAULT_MESON_ARGS: >
40     -Dlibnice:tests=disabled
41     -Dlibnice:examples=disabled
42     -Dopenh264:tests=disabled
43     -Dpygobject:tests=false
44     -Dpython=enabled
45     -Dlibav=enabled
46     -Dugly=enabled
47     -Dbad=enabled
48     -Ddevtools=enabled
49     -Dges=enabled
50     -Drtsp_server=enabled
51     -Dvaapi=enabled
52     -Dsharp=disabled
53     -Dgpl=enabled
54
55   MESON_GST_WERROR: >
56     -Dgstreamer:werror=true
57     -Dgst-plugins-base:werror=true
58     -Dgst-plugins-good:werror=true
59     -Dgst-plugins-ugly:werror=true
60     -Dgst-plugins-bad:werror=true
61     -Dgst-rtsp-server:werror=true
62     -Dgst-libav:werror=true
63     -Dgst-examples:werror=true
64     -Dgst-editing-services:werror=true
65     -Dgst-docs:werror=true
66     -Dgst-omx:werror=true
67     -Dgst-devtools:werror=true
68     -Dgst-python:werror=true
69     -Dgstreamer-vaapi:werror=true
70     -Dgstreamer-sharp:werror=true
71
72 workflow:
73   # https://docs.gitlab.com/ee/ci/yaml/index.html#switch-between-branch-pipelines-and-merge-request-pipelines
74   rules:
75     - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
76       variables:
77         GIT_FETCH_EXTRA_FLAGS: '--no-tags'
78     - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
79       when: never
80     - if: '$CI_COMMIT_TAG'
81     - if: '$CI_COMMIT_BRANCH'
82       variables:
83         GIT_FETCH_EXTRA_FLAGS: '--no-tags'
84
85 #
86 # Global CI policy
87 #
88 # This can be used to configure global behaviour our our jobs.
89 #
90 default:
91   retry:
92     max: 2
93     when:
94       - 'runner_system_failure'
95       - 'stuck_or_timeout_failure'
96       - 'scheduler_failure'
97       - 'api_failure'
98   interruptible: true
99
100 # This is an empty job that is used to trigger the pipeline.
101 trigger:
102   image: alpine:latest
103   stage: 'preparation'
104   variables:
105     GIT_STRATEGY: none
106   script:
107     - echo "Trigger job done, now running the pipeline."
108   rules:
109     # If the MR is assigned to the Merge bot, trigger the pipeline automatically
110     - if: '$CI_MERGE_REQUEST_ASSIGNEES == "gstreamer-merge-bot"'
111     # Require explicit action to trigger tests post merge, but we want to
112     # automatically trigger the integratation stage
113     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH && $CI_JOB_STAGE != "integrate"'
114       when: 'manual'
115     # When the assignee isn't the merge bot, require an explicit action to trigger the pipeline
116     # to avoid wasting CI resources
117     - if: '$CI_MERGE_REQUEST_ASSIGNEES != "gstreamer-merge-bot"'
118       when: 'manual'
119       allow_failure: false
120
121 .fedora image:
122   variables:
123     FDO_DISTRIBUTION_VERSION: '31'
124     FDO_REPO_SUFFIX: "$FEDORA_AMD64_SUFFIX"
125     FDO_DISTRIBUTION_TAG: "$FEDORA_TAG-$GST_UPSTREAM_BRANCH"
126     FDO_DISTRIBUTION_EXEC: 'GIT_BRANCH=$CI_COMMIT_REF_NAME GIT_URL=$CI_REPOSITORY_URL bash ci/docker/fedora/prepare.sh'
127
128 fedora amd64 docker:
129   extends:
130     - '.fedora image'
131     - '.fdo.container-build@fedora'
132   stage: 'preparation'
133   needs: []
134   tags:
135     - 'packet.net'
136
137 .gst-indent image:
138   variables:
139     FDO_DISTRIBUTION_VERSION: 'stretch'
140     FDO_REPO_SUFFIX: "$INDENT_AMD64_SUFFIX"
141     FDO_DISTRIBUTION_TAG: "$INDENT_TAG-$GST_UPSTREAM_BRANCH"
142     FDO_DISTRIBUTION_PACKAGES: 'curl indent git findutils'
143     FDO_DISTRIBUTION_EXEC: 'ci/docker/indent/prepare.sh'
144
145 gst-indent amd64 docker:
146   extends:
147     - '.gst-indent image'
148     - '.fdo.container-build@debian'
149   stage: 'preparation'
150   # Do not depend on the trigger, as we want to run indent always
151   needs: []
152
153 windows amd64 docker:
154   stage: "preparation"
155   needs:
156     - "trigger"
157   timeout: '3h'
158   variables:
159     # Unlike the buildah/linux jobs, this file
160     # needs to be relative to docker/windows/ subdir
161     # as it makes life easier in the powershell script
162     #
163     # We also don't need a CONTEXT_DIR var as its also
164     # hardcoded to be docker/windows/
165     DOCKERFILE: "ci/docker/windows/Dockerfile"
166   tags:
167     - windows
168     - shell
169     - "2022"
170   script:
171     # We need to pass an array and to resolve the env vars, so we can't use a variable:
172     - $DOCKER_BUILD_ARGS = @("--build-arg", "DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH")
173
174     - "& ci/docker/windows/container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $WINDOWS_IMAGE $WINDOWS_UPSTREAM_IMAGE $DOCKERFILE"
175     - |
176       if (!($?)) {
177         echo "Failed to build the image"
178         Exit 1
179       }
180
181
182 # ---- Preparation ----- #
183 #
184 # gst-indent!!
185 #
186 gst indent:
187   extends:
188     - '.gst-indent image'
189     - '.fdo.suffixed-image@debian'
190   stage: 'preparation'
191   needs:
192     - job: 'gst-indent amd64 docker'
193       artifacts: false
194   script:
195     - ./scripts/check-format-c
196     - ./scripts/format-csharp --check
197   rules:
198     # Don't check indentation on post merge pipelines
199     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
200       when: 'manual'
201     - if: '$CI_PROJECT_NAMESPACE != "gstreamer" || $CI_COMMIT_BRANCH != $GST_UPSTREAM_BRANCH'
202       when: 'always'
203
204 #
205 # build setup templates
206 #
207 .build_template: &build
208   - date -R
209   - ci/scripts/handle-subprojects-cache.py subprojects/
210   - date -R
211   - echo $MESON_ARGS
212   - date -R
213   - meson build/ $MESON_ARGS
214   - date -R
215   - ninja -C build/
216   - date -R
217   - ccache --show-stats
218
219 .build_ccache_vars:
220   variables:
221     CCACHE_COMPILERCHECK: 'content'
222     CCACHE_COMPRESS: 'true'
223     CCACHE_BASEDIR: '/cache/gstreamer/gstreamer'
224     CCACHE_DIR: '/cache/gstreamer/gstreamer/ccache/'
225     # shared across everything really
226     CCACHE_MAXSIZE: '10G'
227     CARGO_HOME: '/cache/gstreamer/cargo'
228
229 .base_modules_changes: &modules_changes
230   - .gitlab-ci.yml
231   - gst-env.py
232   - ci/gitlab/*.py
233   - meson.build
234   - subprojects/*.wrap
235   - subprojects/gst-devtools/**/*
236   - subprojects/gst-editing-services/**/*
237   - subprojects/gst-integration-testsuites/**/*
238   - subprojects/gst-libav/**/*
239   - subprojects/gst-omx/**/*
240   - subprojects/gst-plugins-bad/**/*
241   - subprojects/gst-plugins-base/**/*
242   - subprojects/gst-plugins-good/**/*
243   - subprojects/gst-plugins-ugly/**/*
244   - subprojects/gst-python/**/*
245   - subprojects/gstreamer/**/*
246   - subprojects/gstreamer-sharp/**/*
247   - subprojects/gstreamer-vaapi/**/*
248   - subprojects/gst-rtsp-server/**/*
249
250 .simple_fedora_build: &simple_build >-
251   ${DEFAULT_MESON_ARGS}
252   -Dsharp=enabled
253   -Domx=enabled
254   -Dgst-omx:target=generic
255   -Ddoc=disabled
256   -Drs=disabled
257   ${MESON_BUILDTYPE_ARGS}
258   ${MESON_GST_WERROR}
259
260 .build:
261   stage: 'build'
262   extends:
263     - '.build_ccache_vars'
264   needs:
265     - "trigger"
266   # Taking into account the slowest shared runner + time needed to upload the binaries to artifacts
267   # Also need to take into account I/O of pulling docker images and uploading artifacts
268   timeout: '45min'
269   variables:
270     MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
271   script:
272     - *build
273     - ./gst-env.py gst-inspect-1.0 --version
274     - ./gst-env.py gst-inspect-1.0
275   after_script:
276     - mv build/meson-logs/ meson-logs
277   artifacts:
278     expire_in: "7 days"
279     when: "always"
280     paths:
281       - 'meson-logs/'
282   rules:
283     # If this matches, it means the pipeline is running against either the main
284     # or a stable branch, so make it manual
285     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
286       when: manual
287     - changes:
288         *modules_changes
289
290 .build fedora x86_64:
291   extends:
292     - '.fedora image'
293     - '.fdo.suffixed-image@fedora'
294     - '.build'
295   needs:
296     - "trigger"
297     - "fedora amd64 docker"
298   variables:
299     MESON_ARGS: *simple_build
300
301 build fedora x86_64:
302   extends:
303     - '.fedora image'
304     - '.fdo.suffixed-image@fedora'
305     - '.build fedora x86_64'
306   needs:
307     - "trigger"
308     - "fedora amd64 docker"
309   script:
310     - *build
311     - ./gst-env.py gst-inspect-1.0 --version
312     - ./gst-env.py gst-inspect-1.0
313     - meson install --destdir $CI_PROJECT_DIR/destdir -C build
314     - rm -rf $CI_PROJECT_DIR/destdir
315
316 build nodebug fedora x86_64:
317   extends:
318     - '.fedora image'
319     - '.fdo.suffixed-image@fedora'
320     - '.build'
321   needs:
322     - "trigger"
323     - "fedora amd64 docker"
324   variables:
325     MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
326
327 build clang fedora x86_64:
328   extends: '.build fedora x86_64'
329   variables:
330     CC: 'ccache clang'
331     CXX: 'ccache clang++'
332
333 .build windows:
334   image: $WINDOWS_IMAGE
335   stage: 'build'
336   tags:
337     - 'docker'
338     - 'windows'
339     - '2022'
340   needs:
341     - "trigger"
342     - "windows amd64 docker"
343   timeout: '45min'
344   variables:
345     MESON_ARGS: >
346       ${DEFAULT_MESON_ARGS}
347       -Dpython=disabled
348       -Dlibav=disabled
349       -Dvaapi=disabled
350       -Dgst-plugins-base:pango=enabled
351       -Dgst-plugins-good:cairo=enabled
352     # Needs to not be empty otherwise the newline -> space replace command in
353     # `script:` will fail
354     MESON_CROSS_ARGS: ' '
355   rules:
356     # If this matches, it means the pipeline is running against either the main
357     # or a stable branch, so make it manual
358     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
359       when: manual
360     - changes:
361         *modules_changes
362     - changes:
363         - subprojects/win-*/*
364   script:
365     # Make sure powershell exits on errors
366     # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
367     - $ErrorActionPreference = "Stop"
368
369     # Set the code page to UTF-8
370     - chcp 65001
371
372     - ci/scripts/handle-subprojects-cache.py subprojects/
373     # For some reason, options are separated by newline instead of space, so we
374     # have to replace them first.
375     - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
376     - $env:MESON_CROSS_ARGS = $env:MESON_CROSS_ARGS.replace("`n"," ")
377     - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
378         meson build $env:MESON_ARGS $env:MESON_CROSS_ARGS &&
379         meson compile -C build"
380   artifacts:
381    expire_in: "7 days"
382    when: "always"
383    paths:
384      - 'build/meson-logs/'
385
386 build vs2019 amd64:
387   extends: '.build windows'
388   variables:
389     ARCH: 'amd64'
390   script:
391     - !reference [".build windows", "script",]
392     - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
393         .\gst-env.py gst-inspect-1.0.exe --version &&
394         .\gst-env.py gst-inspect-1.0.exe &&
395         mkdir .\destdir &&
396         meson install --destdir=$env:CI_PROJECT_DIR\destdir -C build &&
397         rmdir /s /q  $env:CI_PROJECT_DIR\destdir"
398
399 build vs2019 x86:
400   extends: '.build windows'
401   variables:
402     ARCH: 'x86'
403
404 build vs2019 arm64 uwp:
405   extends: '.build windows'
406   variables:
407     ARCH: 'arm64'
408     # pango pulls in cairo which pulls in pixman which doesn't build because of
409     # https://github.com/mesonbuild/meson/issues/9889
410     MESON_CROSS_ARGS: >
411       -Dgst-plugins-base:pango=disabled
412       -Dgst-plugins-good:cairo=disabled
413       -Dgst-devtools:cairo=disabled
414       --cross-file ci/meson/vs2019-arm64-cross-file.txt
415       --native-file ci/meson/vs2019-x64-native-file.txt
416
417 build msys2 :
418   extends: '.build windows'
419   timeout: '60min'
420   rules:
421     - changes:
422         *modules_changes
423       allow_failure: true
424       when: 'manual'
425   script:
426     # Make sure powershell exits on errors
427     # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
428     - $ErrorActionPreference = "Stop"
429
430     # Set the code page to UTF-8
431     - chcp 65001
432
433     # Configure MSYS2 to use the UCRT64 environment, start in the same directory
434     # and inherit PATH
435     - $env:MSYSTEM = "UCRT64"
436     - $env:CHERE_INVOKING = "1"
437     - $env:MSYS2_PATH_TYPE = "inherit"
438     # For some reason, options are separated by newline instead of space, so we
439     # have to replace them first.
440     - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
441     # Replace forward slashes with backwards so bash doesn't complain
442     - $env:_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\','/')
443     - C:\msys64\usr\bin\bash -lc "meson build $env:MESON_ARGS && ninja -C build"
444
445 # ---- Tests ----- #
446
447 .test:
448   stage: 'test'
449   extends:
450     - '.build_ccache_vars'
451   needs:
452     - "trigger"
453   variables:
454     MESON_ARGS: *simple_build
455
456     # Disable colored output to avoid weird rendering issues
457     GST_DEBUG_NO_COLOR: "true"
458     CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/validate-logs/"
459     GST_VALIDATE_LAUNCHER_FORCE_COLORS: "true"
460     TIMEOUT_FACTOR: "2"
461     CARGO_HOME: "/cache/gstreamer/cargo"
462     # Enable the fault handler so we get backtraces on segfaults.
463     # any non-empty string will do
464     PYTHONFAULTHANDLER: "enabled"
465   rules:
466     - changes:
467         *modules_changes
468   script:
469     - *build
470
471     - echo "-> Running ${TEST_SUITE}"
472     - >
473       ./gst-env.py
474       gst-validate-launcher ${TEST_SUITE}
475       --check-bugs
476       --dump-on-failure
477       --mute
478       --shuffle
479       --no-display
480       --meson-no-rebuild
481       --timeout-factor "${TIMEOUT_FACTOR}"
482       --fail-on-testlist-change
483       -l "${CI_PROJECT_DIR}/validate-logs/"
484       --xunit-file "${CI_PROJECT_DIR}/validate-logs/xunit.xml"
485       ${EXTRA_VALIDATE_ARGS}
486   after_script:
487     - mv build/meson-logs/ meson-logs
488   artifacts:
489     expire_in: '14 days'
490     when: always
491     paths:
492       - 'meson-logs/'
493       - 'validate-logs'
494     reports:
495       junit:
496         - "validate-logs/*.xml"
497
498 .test fedora x86_64:
499   extends:
500     - '.fedora image'
501     - '.fdo.suffixed-image@fedora'
502     - '.test'
503   needs:
504     - "trigger"
505     - "fedora amd64 docker"
506   tags: ['gstreamer']
507
508 check fedora:
509   extends: '.test fedora x86_64'
510   variables:
511     TEST_SUITE: "check.gst*"
512
513 integration testsuites fedora:
514   extends: '.test fedora x86_64'
515   parallel: 8
516   variables:
517     MESON_BUILDTYPE_ARGS: >
518       -Domx=disabled
519       -Dsharp=disabled
520       -Dvaapi=disabled
521       -Dexamples=disabled
522       -Dgst-examples=disabled
523       -Dtests=disabled
524       -Dnls=disabled
525       -Dqt5=disabled
526       -Dgstreamer:benchmarks=disabled
527       -Dgst-plugins-good:gtk3=disabled
528       -Dgst-plugins-bad:microdns=disabled
529       -Dgst-plugins-bad:avtp=disabled
530       -Dgst-plugins-bad:opencv=disabled
531       -Dgst-plugins-bad:webrtc=disabled
532     EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX} --sync"
533     TEST_SUITE: "validate ges"
534
535 # gstreamer-full:
536 gstreamer-full static build:
537   extends: '.build fedora x86_64'
538   stage: 'build'
539   variables:
540     MESON_ARGS: >
541       --default-library=static
542       -Ddoc=disabled
543       $MESON_GST_WERROR
544
545   script:
546   - *build
547   - meson test -C build -v test-gst-full
548   artifacts:
549     expire_in: "7 days"
550     when: "always"
551     paths:
552       - 'meson-logs/'
553
554 gstreamer-full-minimal static build:
555   extends: 'gstreamer-full static build'
556   stage: 'build'
557   variables:
558     MESON_ARGS: >
559       --default-library=static
560       -Ddoc=disabled
561       -Dgstreamer:gst_debug=false
562       -Dauto_features=disabled
563       -Dgstreamer:check=enabled
564       -Dtests=enabled
565       -Dgst-plugins-base:alsa=enabled
566       -Dgst-plugins-base:typefind=enabled
567       -Dgst-plugins-base:pbtypes=enabled
568       -Dgst-full-elements=coreelements:filesrc,fakesink,identity,input-selector
569       -Dgst-full-typefind-functions=typefindfunctions:wav,flv
570       -Dgst-full-device-providers=alsa:alsadeviceprovider
571       -Dgst-full-dynamic-types=pbtypes:video_multiview_flagset
572       $MESON_GST_WERROR
573
574   script:
575   - *build
576   - meson test -C build -v test-gst-full
577   - meson test -C build test-gst-full-features --test-args "-e filesrc,identity,fakesink -E filesink,capsfilter -t audio/x-wav -T video/vivo -d alsadeviceprovider -D v4l2deviceprovider -l GstVideoMultiviewFlagsSet"
578   - strip build/libgstreamer-full-1.0.so
579   - ls -l build/libgstreamer-full-1.0.so
580   artifacts:
581     expire_in: "7 days"
582     when: "always"
583     paths:
584       - 'meson-logs/'
585
586 # Valgrind
587 .valgrind fedora x86_64:
588   extends: '.test fedora x86_64'
589   stage: 'test'
590   variables:
591     EXTRA_VALIDATE_ARGS: "--valgrind"
592
593 valgrind core:
594   extends: '.valgrind fedora x86_64'
595   variables:
596     TEST_SUITE: "check.gstreamer\\..*"
597   rules:
598     - changes:
599       - "*"
600       - scripts/*
601       - ci/**/*
602       - subprojects/gst-devtools/**/*
603       - subprojects/gstreamer/**/*
604
605 valgrind base:
606   extends: '.valgrind fedora x86_64'
607   variables:
608     TEST_SUITE: "check.gst-plugins-base\\..*"
609   rules:
610     - changes:
611       - "*"
612       - scripts/*
613       - ci//**/*
614       - subprojects/gst-devtools/**/*
615       - subprojects/gstreamer/**/*
616       - subprojects/gst-plugins-base/**/*
617
618 valgrind good:
619   extends: '.valgrind fedora x86_64'
620   variables:
621     TEST_SUITE: "check.gst-plugins-good\\..*"
622     # take longer time due to splitmux unit test
623     TIMEOUT_FACTOR: "4"
624   rules:
625     - changes:
626       - "*"
627       - scripts/*
628       - ci/**/*
629       - subprojects/gst-devtools/**/*
630       - subprojects/gstreamer/**/*
631       - subprojects/gst-plugins-base/**/*
632       - subprojects/gst-plugins-good/**/*
633
634 valgrind ugly:
635   extends: '.valgrind fedora x86_64'
636   variables:
637     TEST_SUITE: "check.gst-plugins-ugly\\..*"
638   rules:
639     - changes:
640       - "*"
641       - scripts/*
642       - ci/**/*
643       - subprojects/gst-devtools/**/*
644       - subprojects/gstreamer/**/*
645       - subprojects/gst-plugins-base/**/*
646       - subprojects/gst-plugins-good/**/*
647       - subprojects/gst-plugins-ugly/**/*
648
649 valgrind bad:
650   extends: '.valgrind fedora x86_64'
651   variables:
652     TEST_SUITE: "check.gst-plugins-bad\\..*"
653   rules:
654     - changes:
655       - "*"
656       - scripts/*
657       - ci/**/*
658       - subprojects/gst-devtools/**/*
659       - subprojects/gstreamer/**/*
660       - subprojects/gst-plugins-base/**/*
661       - subprojects/gst-plugins-good/**/*
662       - subprojects/gst-plugins-bad/**/*
663
664 valgrind ges:
665   extends: '.valgrind fedora x86_64'
666   variables:
667     TEST_SUITE: "check.gst-editing-services\\..*"
668   rules:
669     - changes:
670       - "*"
671       - scripts/*
672       - ci/**/*
673       - subprojects/gst-devtools/**/*
674       - subprojects/gstreamer/**/*
675       - subprojects/gst-plugins-base/**/*
676       - subprojects/gst-plugins-good/**/*
677       - subprojects/gst-plugins-bad/**/*
678       - subprojects/gst-editing-services/**/*
679       - subprojects/gst-python/**/*
680   # valgrind ges jobs are racy across the board and simply fail too often.
681   # Someone needs to go through job logs and figure out which jobs to mark
682   # as flaky. Until then, just ignore failures.
683   allow_failure: true
684
685 # ---- Integration ----- #
686
687 .documentation:
688   extends: '.build fedora x86_64'
689   variables:
690     MESON_ARGS: *simple_build
691     MESON_BUILDTYPE_ARGS: "-Ddoc=enabled -Drs=enabled -Dgst-docs:fatal_warnings=true"
692     # Disable werror for the docs build, we don't need it
693     MESON_GST_WERROR: ''
694     CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
695   script:
696   - export PATH=/usr/local/cargo/bin/:/usr/local/bin/:$PATH
697   - export RUSTUP_HOME='/usr/local/rustup'
698
699   - ci/scripts/handle-subprojects-cache.py subprojects/
700   - echo $MESON_ARGS
701   - meson build/ $MESON_ARGS
702   - ccache --show-stats
703
704   - ./gst-env.py ninja -C build/ plugins_doc_caches
705   # Ignore modifications to wrap files made by meson
706   - git checkout subprojects/*.wrap
707   - ./ci/scripts/check-documentation-diff.py
708
709   - ./gst-env.py ninja -C build subprojects/gst-docs/GStreamer-doc
710   - mv build/subprojects/gst-docs/GStreamer-doc/html documentation/
711
712   artifacts:
713     when: always
714     expire_in: "7 days"
715     paths:
716     - documentation/
717     - plugins-cache-diffs/
718
719 #
720 # This jobs runs in gstreamer namespace when after the merge into main branch.
721 # The produced artifact is later used to automatically update the web page.
722 #
723 documentation:
724   stage: integrate
725   extends:
726     - '.documentation'
727   needs:
728     - "fedora amd64 docker"
729   rules:
730     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == "main"'
731
732 #
733 # This job is run in users namespace to validate documentation before merging
734 # MR.
735 #
736 build documentation:
737   extends:
738     - '.documentation'
739   stage: build
740   needs:
741     - "trigger"
742     - "fedora amd64 docker"
743   rules:
744     # Never run post merge, we have the `documentation` always running for that
745     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
746       when: never
747     - changes:
748       - .gitlab-ci.yml
749       - ci/gitlab/*.py
750       - subprojects/*.wrap
751       - subprojects/gst-docs/**/*
752       - subprojects/gst-devtools/**/*
753       - subprojects/gst-editing-services/**/*
754       - subprojects/gst-libav/**/*
755       - subprojects/gst-omx/**/*
756       - subprojects/gst-plugins-bad/**/*
757       - subprojects/gst-plugins-base/**/*
758       - subprojects/gst-plugins-good/**/*
759       - subprojects/gst-plugins-ugly/**/*
760       - subprojects/gstreamer/**/*
761       - subprojects/gstreamer-vaapi/**/*
762       - subprojects/gst-rtsp-server/**/*
763
764 # FIXME: Using trigger: causes permission issues, workaround using old REST API.
765 # https://gitlab.com/gitlab-org/gitlab/-/issues/341737
766 cerbero trigger:
767   stage: build
768   timeout: '4h'
769   tags:
770     - placeholder-job
771   extends:
772     - '.fedora image'
773     - '.fdo.suffixed-image@fedora'
774   needs:
775     - "trigger"
776     - "fedora amd64 docker"
777   script:
778     - ci/gitlab/trigger_cerbero_pipeline.py
779
780   rules:
781     # Never run post merge
782     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
783       when: never
784     - changes:
785       - .gitlab-ci.yml
786       - ci/gitlab/*.py
787       - subprojects/gst-devtools/**/*
788       - subprojects/gst-editing-services/**/*
789       - subprojects/gst-libav/**/*
790       - subprojects/gst-plugins-bad/**/*
791       - subprojects/gst-plugins-base/**/*
792       - subprojects/gst-plugins-good/**/*
793       - subprojects/gst-plugins-ugly/**/*
794       - subprojects/gst-python/**/*
795       - subprojects/gstreamer/**/*
796       - subprojects/gst-rtsp-server/**/*
797       - subprojects/gst-examples/**/*