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