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