ci: fix minor comment typo
[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 stages:
6   - 'trigger'
7   - 'build docker'
8   - 'preparation'
9   - 'pre-build'
10   - 'build'
11   - 'test'
12   # Use the resulting binaries
13   - 'integrate'
14
15 variables:
16   # Branch to track for modules that have no ref specified in the manifest
17   GST_UPSTREAM_BRANCH: 'main'
18   ORC_UPSTREAM_BRANCH: 'master'
19
20   ###
21   # IMPORTANT
22   # These are the version tags for the docker images the CI runs against.
23   # If you are hacking on them or need a them to rebuild, its enough
24   # to change any part of the string of the image you want.
25   ###
26   FEDORA_TAG:  '2021-10-05.0'
27   INDENT_TAG: '2021-10-04.0'
28   WINDOWS_TAG: "2021-10-12.0"
29
30   GST_UPSTREAM_REPO: 'gstreamer/gstreamer'
31   FDO_UPSTREAM_REPO: 'gstreamer/gstreamer'
32
33   FEDORA_AMD64_SUFFIX:  'amd64/fedora'
34   INDENT_AMD64_SUFFIX: 'amd64/gst-indent'
35   WINDOWS_AMD64_SUFFIX: 'amd64/windows'
36   WINDOWS_RUST_AMD64_SUFFIX: 'amd64/windows-rust'
37
38   FEDORA_DOCS_IMAGE: "registry.freedesktop.org/gstreamer/gst-ci/amd64/fedora:2020-07-03.0-master"
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   RUST_MINIMUM_VERSION: '1.54.0'
43   RUST_LATEST_VERSION: '1.55.0'
44
45   WINDOWS_RUST_MINIMUM_IMAGE: "$CI_REGISTRY_IMAGE/$WINDOWS_RUST_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH-rust-$RUST_MINIMUM_VERSION"
46   WINDOWS_RUST_MINIMUM_UPSTREAM_IMAGE: "$CI_REGISTRY/$GST_UPSTREAM_REPO/$WINDOWS_RUST_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH-rust-$RUST_MINIMUM_VERSION"
47
48   WINDOWS_RUST_LATEST_IMAGE: "$CI_REGISTRY_IMAGE/$WINDOWS_RUST_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH-rust-$RUST_LATEST_VERSION"
49   WINDOWS_RUST_LATEST_UPSTREAM_IMAGE: "$CI_REGISTRY/$GST_UPSTREAM_REPO/$WINDOWS_RUST_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH-rust-$RUST_LATEST_VERSION"
50
51   MESON_BUILDTYPE_ARGS: --default-library=both
52   DEFAULT_MESON_ARGS: >
53     -Dlibnice:tests=disabled
54     -Dlibnice:examples=disabled
55     -Dopenh264:tests=disabled
56     -Dpygobject:tests=false
57     -Dpython=enabled
58     -Dlibav=enabled
59     -Dugly=enabled
60     -Dbad=enabled
61     -Ddevtools=enabled
62     -Dges=enabled
63     -Drtsp_server=enabled
64     -Dvaapi=enabled
65     -Dsharp=disabled
66     -Dgpl=enabled
67
68   MESON_GST_WERROR: >
69     -Dgstreamer:werror=true
70     -Dgst-plugins-base:werror=true
71     -Dgst-plugins-good:werror=true
72     -Dgst-plugins-ugly:werror=true
73     -Dgst-plugins-bad:werror=true
74     -Dgst-rtsp-server:werror=true
75     -Dgst-libav:werror=true
76     -Dgst-examples:werror=true
77     -Dgst-editing-services:werror=true
78     -Dgst-docs:werror=true
79     -Dgst-omx:werror=true
80     -Dgst-devtools:werror=true
81     -Dgst-python:werror=true
82     -Dgstreamer-vaapi:werror=true
83     -Dgstreamer-sharp:werror=true
84
85 workflow:
86   # https://docs.gitlab.com/ee/ci/yaml/index.html#switch-between-branch-pipelines-and-merge-request-pipelines
87   rules:
88     - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
89     - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
90       when: never
91     - if: '$CI_COMMIT_BRANCH'
92
93 #
94 # Global CI policy
95 #
96 # This can be used to configure global behaviour our our jobs.
97 #
98 default:
99   retry:
100     max: 2
101     when:
102       - 'runner_system_failure'
103       - 'stuck_or_timeout_failure'
104       - 'scheduler_failure'
105       - 'api_failure'
106   interruptible: true
107
108 # This is an empty job that is used to trigger the pipeline.
109 trigger:
110   image: alpine:latest
111   stage: 'trigger'
112   variables:
113     GIT_STRATEGY: none
114   script:
115     - echo "Trigger job done, now running the pipeline."
116   rules:
117     # If the MR is assigned to the Merge bot, trigger the pipeline automatically
118     - if: '$CI_MERGE_REQUEST_ASSIGNEES == "gstreamer-merge-bot"'
119     # Alway run tests post merged
120     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
121     # When the assignee isn't the merge bot, require an explicit action to trigger the pipeline
122     # to avoid wasting CI resources
123     - if: '$CI_MERGE_REQUEST_ASSIGNEES != "gstreamer-merge-bot"'
124       when: 'manual'
125       allow_failure: false
126
127 .fedora image:
128   variables:
129     FDO_DISTRIBUTION_VERSION: '31'
130     FDO_REPO_SUFFIX: "$FEDORA_AMD64_SUFFIX"
131     FDO_DISTRIBUTION_TAG: "$FEDORA_TAG-$GST_UPSTREAM_BRANCH"
132     FDO_DISTRIBUTION_EXEC: 'DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH bash ci/docker/fedora/prepare.sh'
133
134 fedora amd64 docker:
135   extends:
136     - '.fedora image'
137     - '.fdo.container-build@fedora'
138   stage: 'build docker'
139   needs:
140     - "trigger"
141
142 .gst-indent image:
143   variables:
144     FDO_DISTRIBUTION_VERSION: 'stretch'
145     FDO_REPO_SUFFIX: "$INDENT_AMD64_SUFFIX"
146     FDO_DISTRIBUTION_TAG: "$INDENT_TAG-$GST_UPSTREAM_BRANCH"
147     FDO_DISTRIBUTION_PACKAGES: 'curl indent git findutils'
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   variables:
162     # Unlike the buildah/linux jobs, this file
163     # needs to be relative to docker/windows/ subdir
164     # as it makes life easier in the powershell script
165     #
166     # We also don't need a CONTEXT_DIR var as its also
167     # hardcoded to be docker/windows/
168     DOCKERFILE: "ci/docker/windows/Dockerfile"
169   tags:
170     - windows
171     - shell
172     - "1809"
173   script:
174     # We need to pass an array and to resolve the env vars, so we can't use a variable:
175     - $DOCKER_BUILD_ARGS = @("--build-arg", "DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH")
176
177     - "& ci/docker/windows/container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $WINDOWS_IMAGE $WINDOWS_UPSTREAM_IMAGE $DOCKERFILE"
178     - |
179       if (!($?)) {
180         echo "Failed to build the image"
181         Exit 1
182       }
183
184 .windows rust docker build:
185   stage: 'build docker'
186   needs:
187     - job: 'windows amd64 docker'
188       artifacts: false
189   rules:
190     - if: '$CI_PROJECT_NAME == "gst-ci"'
191   variables:
192     # Unlike the buildah/linux jobs, this file
193     # needs to be relative to docker/windows/ subdir
194     # as it makes life easier in the powershell script
195     #
196     # We also don't need a CONTEXT_DIR var as its also
197     # hardcoded to be docker/windows/
198     DOCKERFILE: 'docker/windows/rust.Dockerfile'
199   tags:
200     - 'windows'
201     - 'shell'
202     - '1809'
203   script:
204     # We need to pass an array and to resolve the env vars, so we can't use a variable:
205     - $DOCKER_BUILD_ARGS = @("--build-arg", "DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH", "--build-arg", "BASE_IMAGE=$WINDOWS_IMAGE", "--build-arg", "RUST_VERSION=$RUST_VERSION")
206
207     - $env:WINDOWS_CONTAINER_SCRIPT_PATH = "$env:CI_PROJECT_DIR\container.ps1"
208     - echo "Fetching $env:WINDOWS_CONTAINER_SCRIPT_URL"
209     - Invoke-WebRequest -Uri $env:WINDOWS_CONTAINER_SCRIPT_URL -OutFile $env:WINDOWS_CONTAINER_SCRIPT_PATH
210
211     - "& $env:WINDOWS_CONTAINER_SCRIPT_PATH $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $RUST_IMAGE $RUST_UPSTREAM_IMAGE $DOCKERFILE"
212     - |
213       if (!($?)) {
214         echo "Failed to build the image"
215         Exit 1
216       }
217
218 windows rust amd64 docker latest stable:
219   extends: '.windows rust docker build'
220   variables:
221     RUST_IMAGE: !reference [variables, "WINDOWS_RUST_LATEST_IMAGE"]
222     RUST_UPSTREAM_IMAGE: !reference [variables, "WINDOWS_RUST_LATEST_UPSTREAM_IMAGE"]
223     RUST_VERSION: !reference [variables, "RUST_LATEST_VERSION"]
224
225 windows rust amd64 docker minimum supported version:
226   extends: '.windows rust docker build'
227   variables:
228     RUST_IMAGE: !reference [variables, "WINDOWS_RUST_MINIMUM_IMAGE"]
229     RUST_UPSTREAM_IMAGE: !reference [variables, "WINDOWS_RUST_MINIMUM_UPSTREAM_IMAGE"]
230     RUST_VERSION: !reference [variables, "RUST_MINIMUM_VERSION"]
231
232
233
234 # ---- Preparation ----- #
235 #
236 # gst-indent!!
237 #
238 gst indent:
239   extends:
240     - '.gst-indent image'
241     - '.fdo.suffixed-image@debian'
242   stage: 'preparation'
243   needs:
244     - job: 'gst-indent amd64 docker'
245       artifacts: false
246   script:
247     # man indent. grep RETURN VALUE, grab a beer on my behalf...
248     - indent --version || true
249     - ./scripts/gst-indent-all
250     - |
251       if git diff --quiet -- ':!subprojects/gst-integration-testsuites/medias' .; then
252           echo "Code is properly formatted"
253       else
254           git diff --color=always -- ':!subprojects/gst-integration-testsuites/medias' .
255           echo 'style diverges, please run gst-indent first'
256           exit 1
257       fi
258
259 #
260 # build setup templates
261 #
262 .build_template: &build
263   - echo $MESON_ARGS
264
265   - meson build/ $MESON_ARGS
266   - ninja -C build/
267   - ccache --show-stats
268
269 .build_ccache_vars:
270   variables:
271     CCACHE_COMPILERCHECK: 'content'
272     CCACHE_COMPRESS: 'true'
273     CCACHE_BASEDIR: '/cache/gstreamer/gstreamer'
274     CCACHE_DIR: '/cache/gstreamer/gstreamer/ccache/'
275     # shared across everything really
276     CCACHE_MAXSIZE: '10G'
277     CARGO_HOME: '/cache/gstreamer/cargo'
278
279 .base_modules_changes: &modules_changes
280   - .gitlab-ci.yml
281   - meson.build
282   - subprojects/*.wrap
283   - subprojects/gst-devtools/**/*
284   - subprojects/gst-editing-services/**/*
285   - subprojects/gst-integration-testsuites/**/*
286   - subprojects/gst-libav/**/*
287   - subprojects/gst-omx/**/*
288   - subprojects/gst-plugins-bad/**/*
289   - subprojects/gst-plugins-base/**/*
290   - subprojects/gst-plugins-good/**/*
291   - subprojects/gst-plugins-ugly/**/*
292   - subprojects/gst-python/**/*
293   - subprojects/gstreamer/**/*
294   - subprojects/gstreamer-sharp/**/*
295   - subprojects/gstreamer-vaapi/**/*
296   - subprojects/gst-rtsp-server/**/*
297
298 .simple_fedora_build: &simple_build >-
299   ${DEFAULT_MESON_ARGS}
300   -Dsharp=enabled
301   -Domx=enabled
302   -Dgst-omx:target=generic
303   -Ddoc=disabled
304   -Drs=disabled
305   ${MESON_BUILDTYPE_ARGS}
306   ${MESON_GST_WERROR}
307
308 .build:
309   stage: 'build'
310   extends:
311     - '.build_ccache_vars'
312   needs:
313     - "trigger"
314   # Taking into account the slowest shared runner + time needed to upload the binaries to artifacts
315   # Also need to take into account I/O of pulling docker images and uploading artifacts
316   timeout: '45min'
317   variables:
318     MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
319   before_script:
320     - export RUSTUP_HOME="/usr/local/rustup"
321     - export CARGO_HOME="/usr/local/cargo"
322     - export PATH="/usr/local/cargo/bin:$PATH"
323
324     - ci/scripts/handle-subprojects-cache.py subprojects/
325     # Update subprojects to respect `.wrap` content
326     - meson subprojects update --reset
327   script:
328     *build
329   after_script:
330     - mv build/meson-logs/ meson-logs
331   artifacts:
332     expire_in: "7 days"
333     when: "always"
334     paths:
335       - 'meson-logs/'
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
344 .build fedora x86_64:
345   extends:
346     - '.fedora image'
347     - '.fdo.suffixed-image@fedora'
348     - '.build'
349   needs:
350     - "fedora amd64 docker"
351   variables:
352     MESON_ARGS: *simple_build
353
354 build nodebug fedora x86_64:
355   extends:
356     - '.fedora image'
357     - '.fdo.suffixed-image@fedora'
358     - '.build'
359   needs:
360     - "fedora amd64 docker"
361   variables:
362     MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
363
364 build clang fedora x86_64:
365   extends: '.build fedora x86_64'
366   variables:
367     CC: 'ccache clang'
368     CXX: 'ccache clang++'
369
370 .build windows:
371   image: $WINDOWS_IMAGE
372   stage: 'build'
373   tags:
374     - 'docker'
375     - 'windows'
376     - '1809'
377   needs:
378     - "windows amd64 docker"
379   timeout: '45min'
380   variables:
381     MESON_ARGS: >
382       ${DEFAULT_MESON_ARGS}
383       -Dpython=disabled
384       -Dlibav=disabled
385       -Dvaapi=disabled
386       -Dgst-plugins-base:pango=enabled
387       -Dgst-plugins-good:cairo=enabled
388   rules:
389     # If this matches, it means the pipeline is running against either the main
390     # or a stable branch, so make it manual
391     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
392       when: manual
393     - changes:
394         *modules_changes
395   before_script:
396     - ci/scripts/handle-subprojects-cache.py subprojects/
397   script:
398     # For some reason, options are separated by newline instead of space, so we
399     # have to replace them first.
400     - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
401     - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
402         meson build $env:MESON_ARGS &&
403         ninja -C build"
404   # XXX: Re-enable when uploading stops timing out
405   #artifacts:
406   #  expire_in: "7 days"
407   #  when: "always"
408   #  paths:
409   #    - 'build/meson-logs/'
410
411 build vs2017 amd64:
412   extends: '.build windows'
413   variables:
414     ARCH: 'amd64'
415
416 build vs2017 x86:
417   extends: '.build windows'
418   variables:
419     ARCH: 'x86'
420
421 build msys2 :
422   extends: '.build windows'
423   timeout: '60min'
424   rules:
425     - changes:
426         *modules_changes
427       allow_failure: true
428       when: 'manual'
429   script:
430     # Make sure powershell exits on errors
431     # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
432     - $ErrorActionPreference = "Stop"
433
434     # Configure MSYS2 to use the UCRT64 environment, start in the same directory
435     # and inherit PATH
436     - $env:MSYSTEM = "UCRT64"
437     - $env:CHERE_INVOKING = "1"
438     - $env:MSYS2_PATH_TYPE = "inherit"
439     # For some reason, options are separated by newline instead of space, so we
440     # have to replace them first.
441     - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
442     # Replace forward slashes with backwards so bash doesn't complain
443     - $env:_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\','/')
444     - C:\msys64\usr\bin\bash -lc "meson build $env:MESON_ARGS && ninja -C build"
445
446 # ---- Tests ----- #
447
448 .test:
449   stage: 'test'
450   extends:
451     - '.build_ccache_vars'
452   needs:
453     - "trigger"
454   variables:
455     MESON_ARGS: *simple_build
456
457     # Disable colored output to avoid weird rendering issues
458     GST_DEBUG_NO_COLOR: "true"
459     CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/validate-logs/"
460     GST_VALIDATE_LAUNCHER_FORCE_COLORS: "true"
461     TIMEOUT_FACTOR: "2"
462     CARGO_HOME: "/cache/gstreamer/cargo"
463     # Enable the fault handler so we get backtraces on segfaults.
464     # any non-empty string will do
465     PYTHONFAULTHANDLER: "enabled"
466   rules:
467     - changes:
468         *modules_changes
469   script:
470     - *build
471
472     - echo "-> Running ${TEST_SUITE}"
473     - >
474       ./gst-env.py
475       gst-validate-launcher ${TEST_SUITE}
476       --check-bugs
477       --dump-on-failure
478       --mute
479       --shuffle
480       --no-display
481       --meson-no-rebuild
482       --timeout-factor "${TIMEOUT_FACTOR}"
483       --fail-on-testlist-change
484       -l "${CI_PROJECT_DIR}/validate-logs/"
485       --xunit-file "${CI_PROJECT_DIR}/validate-logs/xunit.xml"
486       ${EXTRA_VALIDATE_ARGS}
487   after_script:
488     - mv build/meson-logs/ meson-logs
489   artifacts:
490     expire_in: '14 days'
491     when: always
492     paths:
493       - 'meson-logs/'
494       - 'validate-logs'
495     reports:
496       junit:
497         - "validate-logs/*.xml"
498
499 .test fedora x86_64:
500   extends:
501     - '.fedora image'
502     - '.fdo.suffixed-image@fedora'
503     - '.test'
504   needs:
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: 4
516   variables:
517     EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX} --sync"
518     TEST_SUITE: "validate ges"
519
520 # gstreamer-full:
521 gstreamer-full static build:
522   extends: '.build fedora x86_64'
523   stage: 'build'
524   variables:
525     MESON_ARGS: >
526       --default-library=static
527       -Ddoc=disabled
528       $MESON_GST_WERROR
529
530   script:
531   - *build
532   - meson test -C build -v test-gst-full
533   artifacts:
534     expire_in: "7 days"
535     when: "always"
536     paths:
537       - 'meson-logs/'
538
539 gstreamer-full-minimal static build:
540   extends: 'gstreamer-full static build'
541   stage: 'build'
542   variables:
543     MESON_ARGS: >
544       --default-library=static
545       -Ddoc=disabled
546       -Dgstreamer:gst_debug=false
547       -Dauto_features=disabled
548       -Dgstreamer:check=enabled
549       -Dtests=enabled
550       -Dgst-plugins-base:alsa=enabled
551       -Dgst-plugins-base:typefind=enabled
552       -Dgst-plugins-base:pbtypes=enabled
553       -Dgst-full-elements=coreelements:filesrc,fakesink,identity,input-selector
554       -Dgst-full-typefind-functions=typefindfunctions:wav,flv
555       -Dgst-full-device-providers=alsa:alsadeviceprovider
556       -Dgst-full-dynamic-types=pbtypes:video_multiview_flagset
557       $MESON_GST_WERROR
558
559   script:
560   - *build
561   - meson test -C build -v test-gst-full
562   - 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"
563   - strip build/libgstreamer-full-1.0.so
564   - ls -l build/libgstreamer-full-1.0.so
565   artifacts:
566     expire_in: "7 days"
567     when: "always"
568     paths:
569       - 'meson-logs/'
570
571 # Valgrind
572 .valgrind fedora x86_64:
573   extends: '.test fedora x86_64'
574   stage: 'test'
575   variables:
576     EXTRA_VALIDATE_ARGS: "--valgrind"
577
578 valgrind core:
579   extends: '.valgrind fedora x86_64'
580   variables:
581     TEST_SUITE: "check.gstreamer\\..*"
582   rules:
583     - changes:
584       - "*"
585       - scripts/*
586       - ci/**/*
587       - subprojects/gst-devtools/**/*
588       - subprojects/gstreamer/**/*
589
590 valgrind base:
591   extends: '.valgrind fedora x86_64'
592   variables:
593     TEST_SUITE: "check.gst-plugins-base\\..*"
594   rules:
595     - changes:
596       - "*"
597       - scripts/*
598       - ci//**/*
599       - subprojects/gst-devtools/**/*
600       - subprojects/gstreamer/**/*
601       - subprojects/gst-plugins-base/**/*
602
603 valgrind good:
604   extends: '.valgrind fedora x86_64'
605   variables:
606     TEST_SUITE: "check.gst-plugins-good\\..*"
607     # take longer time due to splitmux unit test
608     TIMEOUT_FACTOR: "4"
609   rules:
610     - changes:
611       - "*"
612       - scripts/*
613       - ci/**/*
614       - subprojects/gst-devtools/**/*
615       - subprojects/gstreamer/**/*
616       - subprojects/gst-plugins-base/**/*
617       - subprojects/gst-plugins-good/**/*
618
619 valgrind ugly:
620   extends: '.valgrind fedora x86_64'
621   variables:
622     TEST_SUITE: "check.gst-plugins-ugly\\..*"
623   rules:
624     - changes:
625       - "*"
626       - scripts/*
627       - ci/**/*
628       - subprojects/gst-devtools/**/*
629       - subprojects/gstreamer/**/*
630       - subprojects/gst-plugins-base/**/*
631       - subprojects/gst-plugins-good/**/*
632       - subprojects/gst-plugins-ugly/**/*
633
634 valgrind bad:
635   extends: '.valgrind fedora x86_64'
636   variables:
637     TEST_SUITE: "check.gst-plugins-bad\\..*"
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-bad/**/*
648
649 valgrind ges:
650   extends: '.valgrind fedora x86_64'
651   variables:
652     TEST_SUITE: "check.gst-editing-services\\..*"
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       - subprojects/gst-editing-services/**/*
664
665 # ---- Integration ----- #
666
667 .documentation:
668   image: $FEDORA_DOCS_IMAGE
669   extends:
670     - '.build_ccache_vars'
671   variables:
672     MESON_ARGS: *simple_build
673     MESON_BUILDTYPE_ARGS: "-Ddoc=enabled"
674     CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
675   script:
676   # FIXME: should rebuild the image with newer versions!
677   - pip3 install --upgrade hotdoc
678   - pip3 install --upgrade meson
679   - *build
680   - ./gst-env.py ninja -C build/ plugins_doc_caches
681   - ./ci/scripts/check-documentation-diff.py
682   - ./gst-env.py hotdoc run --conf-file=build/subprojects/gst-docs/GStreamer-doc.json --fatal-warnings
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   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     - "trigger"
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/freedesktop_doc_importer.sh
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   extends:
740     - '.fedora image'
741     - '.fdo.suffixed-image@fedora'
742   needs:
743     - "fedora amd64 docker"
744   script:
745     - ci/gitlab/trigger_cerbero_pipeline.py
746
747   rules:
748     # Never run post merge
749     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
750       when: never
751     - changes:
752       - .gitlab-ci.yml
753       - ci/gitlab/trigger_cerbero_pipeline.py
754       - subprojects/gst-devtools/**/*
755       - subprojects/gst-editing-services/**/*
756       - subprojects/gst-libav/**/*
757       - subprojects/gst-plugins-bad/**/*
758       - subprojects/gst-plugins-base/**/*
759       - subprojects/gst-plugins-good/**/*
760       - subprojects/gst-plugins-ugly/**/*
761       - subprojects/gst-python/**/*
762       - subprojects/gstreamer/**/*
763       - subprojects/gst-rtsp-server/**/*
764       - subprojects/gst-examples/**/*