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