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