Fix GStreamer msys2 builds in the CI
[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     # When the assignee isn't the merge bot, require an explicit action to trigger the pipeline
117     # to avoid wasting CI resources
118     - if: '$CI_MERGE_REQUEST_ASSIGNEES != "gstreamer-merge-bot"'
119       when: 'manual'
120       allow_failure: false
121     # Alway run tests post merged
122     - if: '$CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
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
334 .build fedora x86_64:
335   extends:
336     - '.fedora image'
337     - '.fdo.suffixed-image@fedora'
338     - '.build'
339   needs:
340     - "fedora amd64 docker"
341   variables:
342     MESON_ARGS: *simple_build
343   rules:
344     - changes:
345         *modules_changes
346     # If this matches, it means the pipeline is running against either the main
347     # or a stable branch, so make it manual
348     - if: '$CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
349       when: manual
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: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
365
366 build static nodebug fedora x86_64:
367   extends: 'build nodebug fedora x86_64'
368   variables:
369     MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
370
371 build clang fedora x86_64:
372   extends: '.build fedora x86_64'
373   variables:
374     CC: 'ccache clang'
375     CXX: 'ccache clang++'
376
377 .build windows:
378   image: $WINDOWS_IMAGE
379   stage: 'build'
380   tags:
381     - 'docker'
382     - 'windows'
383     - '1809'
384   needs:
385     - "windows amd64 docker"
386   timeout: '45min'
387   variables:
388     MESON_ARGS: >
389       ${DEFAULT_MESON_ARGS}
390       -Dpython=disabled
391       -Dlibav=disabled
392       -Dvaapi=disabled
393       -Dgst-plugins-base:pango=enabled
394       -Dgst-plugins-good:cairo=enabled
395   rules:
396     - changes:
397         *modules_changes
398     # If this matches, it means the pipeline is running against either the main
399     # or a stable branch, so make it manual
400     - if: '$CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
401       when: manual
402   before_script:
403     - ci/scripts/handle-subprojects-cache.py subprojects/
404   script:
405     # For some reason, options are separated by newline instead of space, so we
406     # have to replace them first.
407     - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
408     - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
409         meson build $env:MESON_ARGS &&
410         ninja -C build"
411   # XXX: Re-enable when uploading stops timing out
412   #artifacts:
413   #  expire_in: "7 days"
414   #  when: "always"
415   #  paths:
416   #    - 'build/meson-logs/'
417
418 build vs2017 amd64:
419   extends: '.build windows'
420   variables:
421     ARCH: 'amd64'
422
423 build vs2017 x86:
424   extends: '.build windows'
425   variables:
426     ARCH: 'x86'
427
428 build msys2 :
429   extends: '.build windows'
430   timeout: '60min'
431   rules:
432     - changes:
433         *modules_changes
434       allow_failure: true
435       when: 'manual'
436   script:
437     # Make sure powershell exists on errors
438     # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
439     - $ErrorActionPreference = "Stop"
440
441     # Configure MSYS2 to use the UCRT64 environment, start in the same directory
442     # and inherit PATH
443     - $env:MSYSTEM = "UCRT64"
444     - $env:CHERE_INVOKING = "1"
445     - $env:MSYS2_PATH_TYPE = "inherit"
446     # For some reason, options are separated by newline instead of space, so we
447     # have to replace them first.
448     - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
449     # Replace forward slashes with backwards so bash doesn't complain
450     - $env:_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\','/')
451     - C:\msys64\usr\bin\bash -lc "meson build $env:MESON_ARGS && ninja -C build"
452
453 # ---- Tests ----- #
454
455 .test:
456   stage: 'test'
457   extends:
458     - '.build_ccache_vars'
459   needs:
460     - "trigger"
461   variables:
462     MESON_ARGS: *simple_build
463
464     # Disable colored output to avoid weird rendering issues
465     GST_DEBUG_NO_COLOR: "true"
466     CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/validate-logs/"
467     GST_VALIDATE_LAUNCHER_FORCE_COLORS: "true"
468     TIMEOUT_FACTOR: "2"
469     CARGO_HOME: "/cache/gstreamer/cargo"
470     # Enable the fault handler so we get backtraces on segfaults.
471     # any non-empty string will do
472     PYTHONFAULTHANDLER: "enabled"
473   rules:
474     - changes:
475         *modules_changes
476   script:
477     - *build
478
479     - echo "-> Running ${TEST_SUITE}"
480     - >
481       ./gst-env.py
482       gst-validate-launcher ${TEST_SUITE}
483       --dump-on-failure
484       --mute
485       --shuffle
486       --no-display
487       --meson-no-rebuild
488       --timeout-factor "${TIMEOUT_FACTOR}"
489       --fail-on-testlist-change
490       -l "${CI_PROJECT_DIR}/validate-logs/"
491       --xunit-file "${CI_PROJECT_DIR}/validate-logs/xunit.xml"
492       ${EXTRA_VALIDATE_ARGS}
493   after_script:
494     - mv build/meson-logs/ meson-logs
495   artifacts:
496     expire_in: '14 days'
497     when: always
498     paths:
499       - 'meson-logs/'
500       - 'validate-logs'
501     reports:
502       junit:
503         - "validate-logs/*.xml"
504
505 .test fedora x86_64:
506   extends:
507     - '.fedora image'
508     - '.fdo.suffixed-image@fedora'
509     - '.test'
510   needs:
511     - "fedora amd64 docker"
512   tags: ['gstreamer']
513
514 check fedora:
515   extends: '.test fedora x86_64'
516   variables:
517     TEST_SUITE: "check.gst*"
518
519 integration testsuites fedora:
520   extends: '.test fedora x86_64'
521   parallel: 4
522   variables:
523     EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --check-bugs --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX} --sync"
524     TEST_SUITE: "validate ges"
525
526 # gstreamer-full:
527 # introspection has been disabled as the static build does not support it.
528 # See https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/162
529 gstreamer-full:
530   extends: 'build static fedora x86_64'
531   stage: integrate
532   variables:
533     MESON_ARGS: >
534       --default-library=static
535       -Dintrospection=disabled
536       $MESON_GST_WERROR
537   rules:
538     - changes:
539       - "*"
540       - scripts/*
541       - ci/**/*
542     # If this matches, it means the pipeline is running against either the main
543     # or a stable branch, so make it manual
544     - if: '$CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
545       when: manual
546
547   script:
548   - *build
549   - meson test -C build -v test-gst-full
550   artifacts:
551     expire_in: "7 days"
552     when: "always"
553     paths:
554       - 'meson-logs/'
555
556 gstreamer-full-minimal:
557   extends: 'build static fedora x86_64'
558   stage: integrate
559   variables:
560     MESON_ARGS: >
561       --default-library=static
562       -Dauto_features=disabled
563       -Dgstreamer:check=enabled
564       -Dtests=enabled
565       -Dgst-plugins-base:alsa=enabled
566       -Dgst-plugins-base:typefind=enabled
567       -Dgst-plugins-base:pbtypes=enabled
568       -Dgst-full-elements=coreelements:filesrc,fakesink,identity,input-selector
569       -Dgst-full-typefind-functions=typefindfunctions:wav,flv
570       -Dgst-full-device-providers=alsa:alsadeviceprovider
571       -Dgst-full-dynamic-types=pbtypes:video_multiview_flagset
572       $MESON_GST_WERROR
573
574   script:
575   - *build
576   - meson test -C build -v test-gst-full
577   - 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"
578   - strip build/libgstreamer-full-1.0.so
579   - ls -l build/libgstreamer-full-1.0.so
580   artifacts:
581     expire_in: "7 days"
582     when: "always"
583     paths:
584       - 'meson-logs/'
585
586 # Valgrind
587 .valgrind fedora x86_64:
588   extends: '.test fedora x86_64'
589   stage: 'test'
590   variables:
591     EXTRA_VALIDATE_ARGS: "--valgrind"
592
593 valgrind core:
594   extends: '.valgrind fedora x86_64'
595   parallel: 2
596   variables:
597     TEST_SUITE: "check.gstreamer\\..*"
598     EXTRA_VALIDATE_ARGS: "--valgrind --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX}"
599   rules:
600     - changes:
601       - "*"
602       - scripts/*
603       - ci/**/*
604       - subprojects/gst-devtools/**/*
605       - subprojects/gstreamer/**/*
606
607 valgrind base:
608   extends: '.valgrind fedora x86_64'
609   parallel: 4
610   variables:
611     TEST_SUITE: "check.gst-plugins-base\\..*"
612     EXTRA_VALIDATE_ARGS: "--valgrind --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX}"
613   rules:
614     - changes:
615       - "*"
616       - scripts/*
617       - ci//**/*
618       - subprojects/gst-devtools/**/*
619       - subprojects/gstreamer/**/*
620       - subprojects/gst-plugins-base/**/*
621
622 valgrind good:
623   extends: '.valgrind fedora x86_64'
624   variables:
625     TEST_SUITE: "check.gst-plugins-good\\..*"
626     # take longer time due to splitmux unit test
627     TIMEOUT_FACTOR: "4"
628   rules:
629     - changes:
630       - "*"
631       - scripts/*
632       - ci/**/*
633       - subprojects/gst-devtools/**/*
634       - subprojects/gstreamer/**/*
635       - subprojects/gst-plugins-base/**/*
636       - subprojects/gst-plugins-good/**/*
637
638 valgrind ugly:
639   extends: '.valgrind fedora x86_64'
640   variables:
641     TEST_SUITE: "check.gst-plugins-ugly\\..*"
642   rules:
643     - changes:
644       - "*"
645       - scripts/*
646       - ci/**/*
647       - subprojects/gst-devtools/**/*
648       - subprojects/gstreamer/**/*
649       - subprojects/gst-plugins-base/**/*
650       - subprojects/gst-plugins-good/**/*
651       - subprojects/gst-plugins-ugly/**/*
652
653 valgrind bad:
654   extends: '.valgrind fedora x86_64'
655   variables:
656     TEST_SUITE: "check.gst-plugins-bad\\..*"
657   rules:
658     - changes:
659       - "*"
660       - scripts/*
661       - ci/**/*
662       - subprojects/gst-devtools/**/*
663       - subprojects/gstreamer/**/*
664       - subprojects/gst-plugins-base/**/*
665       - subprojects/gst-plugins-good/**/*
666       - subprojects/gst-plugins-bad/**/*
667
668 valgrind ges:
669   extends: '.valgrind fedora x86_64'
670   variables:
671     TEST_SUITE: "check.gst-editing-services\\..*"
672   rules:
673     - changes:
674       - "*"
675       - scripts/*
676       - ci/**/*
677       - subprojects/gst-devtools/**/*
678       - subprojects/gstreamer/**/*
679       - subprojects/gst-plugins-base/**/*
680       - subprojects/gst-plugins-good/**/*
681       - subprojects/gst-plugins-bad/**/*
682       - subprojects/gst-editing-services/**/*
683
684 # ---- Integration ----- #
685
686 .documentation:
687   image: $FEDORA_DOCS_IMAGE
688   extends:
689     - '.build_ccache_vars'
690   variables:
691     MESON_ARGS: *simple_build
692     MESON_BUILDTYPE_ARGS: "-Ddoc=enabled"
693     CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
694   script:
695   - pip3 install --upgrade hotdoc
696   - *build
697   - ./gst-env.py ninja -C build/ plugins_doc_caches
698   - ./ci/scripts/check-documentation-diff.py
699   - ./gst-env.py hotdoc run --conf-file=build/subprojects/gst-docs/GStreamer-doc.json --fatal-warnings
700   - mv build/subprojects/gst-docs/GStreamer-doc/html documentation/
701
702   artifacts:
703     when: always
704     expire_in: "7 days"
705     paths:
706     - documentation/
707     - plugins-cache-diffs/
708
709 #
710 # This jobs runs in gsrtreamer namespace when after the merge into main branch.
711 # The produced artifact is later used to automatically update the web page.
712 #
713 documentation:
714   stage: integrate
715   extends:
716     - '.documentation'
717   needs: []
718   rules:
719     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == "main"'
720
721 #
722 # This job is run in users namespace to validate documentation before merging
723 # MR.
724 #
725 build documentation:
726   extends:
727     - '.documentation'
728   stage: build
729   needs:
730     - "trigger"
731   rules:
732     - changes:
733       - .gitlab-ci.yml
734       - ci/gitlab/freedesktop_doc_importer.sh
735       - subprojects/*.wrap
736       - subprojects/gst-docs/**/*
737       - subprojects/gst-devtools/**/*
738       - subprojects/gst-editing-services/**/*
739       - subprojects/gst-libav/**/*
740       - subprojects/gst-omx/**/*
741       - subprojects/gst-plugins-bad/**/*
742       - subprojects/gst-plugins-base/**/*
743       - subprojects/gst-plugins-good/**/*
744       - subprojects/gst-plugins-ugly/**/*
745       - subprojects/gstreamer/**/*
746       - subprojects/gstreamer-vaapi/**/*
747       - subprojects/gst-rtsp-server/**/*
748     - if: '$CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
749       when: never
750
751 # FIXME: Using trigger: causes permission issues, workaround using old REST API.
752 # https://gitlab.com/gitlab-org/gitlab/-/issues/341737
753 cerbero trigger:
754   stage: build
755   extends:
756     - '.fedora image'
757     - '.fdo.suffixed-image@fedora'
758   needs:
759     - "fedora amd64 docker"
760   script:
761     - ci/gitlab/trigger_cerbero_pipeline.py
762
763   rules:
764     - changes:
765       - .gitlab-ci.yml
766       - ci/gitlab/trigger_cerbero_pipeline.py
767       - subprojects/gst-devtools/**/*
768       - subprojects/gst-editing-services/**/*
769       - subprojects/gst-libav/**/*
770       - subprojects/gst-plugins-bad/**/*
771       - subprojects/gst-plugins-base/**/*
772       - subprojects/gst-plugins-good/**/*
773       - subprojects/gst-plugins-ugly/**/*
774       - subprojects/gst-python/**/*
775       - subprojects/gstreamer/**/*
776       - subprojects/gst-rtsp-server/**/*
777       - subprojects/gst-examples/**/*
778     - if: '$CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
779       when: never