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