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"
12 # Use the resulting binaries
18 # Branch to track for modules that have no ref specified in the manifest
19 GST_UPSTREAM_BRANCH: 'main'
20 ORC_UPSTREAM_BRANCH: 'master'
24 # These are the version tags for the docker images the CI runs against.
25 # If you are hacking on them or need a them to rebuild, its enough
26 # to change any part of the string of the image you want.
28 FEDORA_TAG: '2021-10-05.0'
29 INDENT_TAG: '2021-10-04.0'
30 WINDOWS_TAG: "2021-10-12.0"
32 GST_UPSTREAM_REPO: 'gstreamer/gstreamer'
33 FDO_UPSTREAM_REPO: 'gstreamer/gstreamer'
35 FEDORA_AMD64_SUFFIX: 'amd64/fedora'
36 INDENT_AMD64_SUFFIX: 'amd64/gst-indent'
37 WINDOWS_AMD64_SUFFIX: 'amd64/windows'
38 WINDOWS_RUST_AMD64_SUFFIX: 'amd64/windows-rust'
40 FEDORA_DOCS_IMAGE: "registry.freedesktop.org/gstreamer/gst-ci/amd64/fedora:2020-07-03.0-master"
41 WINDOWS_IMAGE: "$CI_REGISTRY_IMAGE/$WINDOWS_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH"
42 WINDOWS_UPSTREAM_IMAGE: "$CI_REGISTRY/$GST_UPSTREAM_REPO/$WINDOWS_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH"
44 RUST_MINIMUM_VERSION: '1.54.0'
45 RUST_LATEST_VERSION: '1.55.0'
47 WINDOWS_RUST_MINIMUM_IMAGE: "$CI_REGISTRY_IMAGE/$WINDOWS_RUST_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH-rust-$RUST_MINIMUM_VERSION"
48 WINDOWS_RUST_MINIMUM_UPSTREAM_IMAGE: "$CI_REGISTRY/$GST_UPSTREAM_REPO/$WINDOWS_RUST_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH-rust-$RUST_MINIMUM_VERSION"
50 WINDOWS_RUST_LATEST_IMAGE: "$CI_REGISTRY_IMAGE/$WINDOWS_RUST_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH-rust-$RUST_LATEST_VERSION"
51 WINDOWS_RUST_LATEST_UPSTREAM_IMAGE: "$CI_REGISTRY/$GST_UPSTREAM_REPO/$WINDOWS_RUST_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH-rust-$RUST_LATEST_VERSION"
53 MESON_BUILDTYPE_ARGS: --default-library=both
55 -Dlibnice:tests=disabled
56 -Dlibnice:examples=disabled
57 -Dopenh264:tests=disabled
58 -Dpygobject:tests=false
71 -Dgstreamer:werror=true
72 -Dgst-plugins-base:werror=true
73 -Dgst-plugins-good:werror=true
74 -Dgst-plugins-ugly:werror=true
75 -Dgst-plugins-bad:werror=true
76 -Dgst-rtsp-server:werror=true
77 -Dgst-libav:werror=true
78 -Dgst-examples:werror=true
79 -Dgst-editing-services:werror=true
80 -Dgst-docs:werror=true
82 -Dgst-devtools:werror=true
83 -Dgst-python:werror=true
84 -Dgstreamer-vaapi:werror=true
85 -Dgstreamer-sharp:werror=true
88 # https://docs.gitlab.com/ee/ci/yaml/index.html#switch-between-branch-pipelines-and-merge-request-pipelines
90 - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
91 - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
93 - if: '$CI_COMMIT_BRANCH'
98 # This can be used to configure global behaviour our our jobs.
104 - 'runner_system_failure'
105 - 'stuck_or_timeout_failure'
106 - 'scheduler_failure'
110 # This is an empty job that is used to trigger the pipeline.
117 - echo "Trigger job done, now running the pipeline."
119 # If the MR is assigned to the Merge bot, trigger the pipeline automatically
120 - if: '$CI_MERGE_REQUEST_ASSIGNEES == "gstreamer-merge-bot"'
121 # Alway run tests post merged
122 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
123 # When the assignee isn't the merge bot, require an explicit action to trigger the pipeline
124 # to avoid wasting CI resources
125 - if: '$CI_MERGE_REQUEST_ASSIGNEES != "gstreamer-merge-bot"'
131 FDO_DISTRIBUTION_VERSION: '31'
132 FDO_REPO_SUFFIX: "$FEDORA_AMD64_SUFFIX"
133 FDO_DISTRIBUTION_TAG: "$FEDORA_TAG-$GST_UPSTREAM_BRANCH"
134 FDO_DISTRIBUTION_EXEC: 'DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH bash ci/docker/fedora/prepare.sh'
139 - '.fdo.container-build@fedora'
140 stage: 'build docker'
146 FDO_DISTRIBUTION_VERSION: 'stretch'
147 FDO_REPO_SUFFIX: "$INDENT_AMD64_SUFFIX"
148 FDO_DISTRIBUTION_TAG: "$INDENT_TAG-$GST_UPSTREAM_BRANCH"
149 FDO_DISTRIBUTION_PACKAGES: 'curl indent git findutils'
151 gst-indent amd64 docker:
153 - '.gst-indent image'
154 - '.fdo.container-build@debian'
155 stage: 'build docker'
156 # Do not depend on the trigger, as we want to run indent always
159 windows amd64 docker:
160 stage: "build docker"
164 # Unlike the buildah/linux jobs, this file
165 # needs to be relative to docker/windows/ subdir
166 # as it makes life easier in the powershell script
168 # We also don't need a CONTEXT_DIR var as its also
169 # hardcoded to be docker/windows/
170 DOCKERFILE: "ci/docker/windows/Dockerfile"
176 # We need to pass an array and to resolve the env vars, so we can't use a variable:
177 - $DOCKER_BUILD_ARGS = @("--build-arg", "DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH")
179 - "& ci/docker/windows/container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $WINDOWS_IMAGE $WINDOWS_UPSTREAM_IMAGE $DOCKERFILE"
182 echo "Failed to build the image"
186 .windows rust docker build:
187 stage: 'build docker'
189 - job: 'windows amd64 docker'
192 - if: '$CI_PROJECT_NAME == "gst-ci"'
194 # Unlike the buildah/linux jobs, this file
195 # needs to be relative to docker/windows/ subdir
196 # as it makes life easier in the powershell script
198 # We also don't need a CONTEXT_DIR var as its also
199 # hardcoded to be docker/windows/
200 DOCKERFILE: 'docker/windows/rust.Dockerfile'
206 # We need to pass an array and to resolve the env vars, so we can't use a variable:
207 - $DOCKER_BUILD_ARGS = @("--build-arg", "DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH", "--build-arg", "BASE_IMAGE=$WINDOWS_IMAGE", "--build-arg", "RUST_VERSION=$RUST_VERSION")
209 - $env:WINDOWS_CONTAINER_SCRIPT_PATH = "$env:CI_PROJECT_DIR\container.ps1"
210 - echo "Fetching $env:WINDOWS_CONTAINER_SCRIPT_URL"
211 - Invoke-WebRequest -Uri $env:WINDOWS_CONTAINER_SCRIPT_URL -OutFile $env:WINDOWS_CONTAINER_SCRIPT_PATH
213 - "& $env:WINDOWS_CONTAINER_SCRIPT_PATH $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $RUST_IMAGE $RUST_UPSTREAM_IMAGE $DOCKERFILE"
216 echo "Failed to build the image"
220 windows rust amd64 docker latest stable:
221 extends: '.windows rust docker build'
223 RUST_IMAGE: !reference [variables, "WINDOWS_RUST_LATEST_IMAGE"]
224 RUST_UPSTREAM_IMAGE: !reference [variables, "WINDOWS_RUST_LATEST_UPSTREAM_IMAGE"]
225 RUST_VERSION: !reference [variables, "RUST_LATEST_VERSION"]
227 windows rust amd64 docker minimum supported version:
228 extends: '.windows rust docker build'
230 RUST_IMAGE: !reference [variables, "WINDOWS_RUST_MINIMUM_IMAGE"]
231 RUST_UPSTREAM_IMAGE: !reference [variables, "WINDOWS_RUST_MINIMUM_UPSTREAM_IMAGE"]
232 RUST_VERSION: !reference [variables, "RUST_MINIMUM_VERSION"]
236 # ---- Preparation ----- #
242 - '.gst-indent image'
243 - '.fdo.suffixed-image@debian'
246 - job: 'gst-indent amd64 docker'
249 # man indent. grep RETURN VALUE, grab a beer on my behalf...
250 - indent --version || true
251 - ./scripts/gst-indent-all
253 if git diff --quiet -- ':!subprojects/gst-integration-testsuites/medias' .; then
254 echo "Code is properly formatted"
256 git diff --color=always -- ':!subprojects/gst-integration-testsuites/medias' .
257 echo 'style diverges, please run gst-indent first'
262 # build setup templates
264 .build_template: &build
267 - meson build/ $MESON_ARGS
269 - ccache --show-stats
273 CCACHE_COMPILERCHECK: 'content'
274 CCACHE_COMPRESS: 'true'
275 CCACHE_BASEDIR: '/cache/gstreamer/gstreamer'
276 CCACHE_DIR: '/cache/gstreamer/gstreamer/ccache/'
277 # shared across everything really
278 CCACHE_MAXSIZE: '10G'
279 CARGO_HOME: '/cache/gstreamer/cargo'
281 .base_modules_changes: &modules_changes
285 - subprojects/gst-devtools/**/*
286 - subprojects/gst-editing-services/**/*
287 - subprojects/gst-integration-testsuites/**/*
288 - subprojects/gst-libav/**/*
289 - subprojects/gst-omx/**/*
290 - subprojects/gst-plugins-bad/**/*
291 - subprojects/gst-plugins-base/**/*
292 - subprojects/gst-plugins-good/**/*
293 - subprojects/gst-plugins-ugly/**/*
294 - subprojects/gst-python/**/*
295 - subprojects/gstreamer/**/*
296 - subprojects/gstreamer-sharp/**/*
297 - subprojects/gstreamer-vaapi/**/*
298 - subprojects/gst-rtsp-server/**/*
300 .simple_fedora_build: &simple_build >-
301 ${DEFAULT_MESON_ARGS}
304 -Dgst-omx:target=generic
307 ${MESON_BUILDTYPE_ARGS}
313 - '.build_ccache_vars'
316 # Taking into account the slowest shared runner + time needed to upload the binaries to artifacts
317 # Also need to take into account I/O of pulling docker images and uploading artifacts
320 MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
322 - export RUSTUP_HOME="/usr/local/rustup"
323 - export CARGO_HOME="/usr/local/cargo"
324 - export PATH="/usr/local/cargo/bin:$PATH"
326 - ci/scripts/handle-subprojects-cache.py subprojects/
327 # Update subprojects to respect `.wrap` content
328 - meson subprojects update --reset
332 - mv build/meson-logs/ meson-logs
339 # If this matches, it means the pipeline is running against either the main
340 # or a stable branch, so make it manual
341 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
346 .build fedora x86_64:
349 - '.fdo.suffixed-image@fedora'
352 - "fedora amd64 docker"
354 MESON_ARGS: *simple_build
356 build nodebug fedora x86_64:
359 - '.fdo.suffixed-image@fedora'
362 - "fedora amd64 docker"
364 MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
366 build clang fedora x86_64:
367 extends: '.build fedora x86_64'
370 CXX: 'ccache clang++'
373 image: $WINDOWS_IMAGE
380 - "windows amd64 docker"
384 ${DEFAULT_MESON_ARGS}
388 -Dgst-plugins-base:pango=enabled
389 -Dgst-plugins-good:cairo=enabled
391 # If this matches, it means the pipeline is running against either the main
392 # or a stable branch, so make it manual
393 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
398 - ci/scripts/handle-subprojects-cache.py subprojects/
400 # For some reason, options are separated by newline instead of space, so we
401 # have to replace them first.
402 - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
403 - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
404 meson build $env:MESON_ARGS &&
406 # XXX: Re-enable when uploading stops timing out
408 # expire_in: "7 days"
411 # - 'build/meson-logs/'
414 extends: '.build windows'
419 extends: '.build windows'
424 extends: '.build windows'
432 # Make sure powershell exits on errors
433 # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
434 - $ErrorActionPreference = "Stop"
436 # Configure MSYS2 to use the UCRT64 environment, start in the same directory
438 - $env:MSYSTEM = "UCRT64"
439 - $env:CHERE_INVOKING = "1"
440 - $env:MSYS2_PATH_TYPE = "inherit"
441 # For some reason, options are separated by newline instead of space, so we
442 # have to replace them first.
443 - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
444 # Replace forward slashes with backwards so bash doesn't complain
445 - $env:_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\','/')
446 - C:\msys64\usr\bin\bash -lc "meson build $env:MESON_ARGS && ninja -C build"
453 - '.build_ccache_vars'
457 MESON_ARGS: *simple_build
459 # Disable colored output to avoid weird rendering issues
460 GST_DEBUG_NO_COLOR: "true"
461 CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/validate-logs/"
462 GST_VALIDATE_LAUNCHER_FORCE_COLORS: "true"
464 CARGO_HOME: "/cache/gstreamer/cargo"
465 # Enable the fault handler so we get backtraces on segfaults.
466 # any non-empty string will do
467 PYTHONFAULTHANDLER: "enabled"
474 - echo "-> Running ${TEST_SUITE}"
477 gst-validate-launcher ${TEST_SUITE}
484 --timeout-factor "${TIMEOUT_FACTOR}"
485 --fail-on-testlist-change
486 -l "${CI_PROJECT_DIR}/validate-logs/"
487 --xunit-file "${CI_PROJECT_DIR}/validate-logs/xunit.xml"
488 ${EXTRA_VALIDATE_ARGS}
490 - mv build/meson-logs/ meson-logs
499 - "validate-logs/*.xml"
504 - '.fdo.suffixed-image@fedora'
507 - "fedora amd64 docker"
511 extends: '.test fedora x86_64'
513 TEST_SUITE: "check.gst*"
515 integration testsuites fedora:
516 extends: '.test fedora x86_64'
519 EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX} --sync"
520 TEST_SUITE: "validate ges"
523 gstreamer-full static build:
524 extends: '.build fedora x86_64'
528 --default-library=static
534 - meson test -C build -v test-gst-full
541 gstreamer-full-minimal static build:
542 extends: 'gstreamer-full static build'
546 --default-library=static
548 -Dgstreamer:gst_debug=false
549 -Dauto_features=disabled
550 -Dgstreamer:check=enabled
552 -Dgst-plugins-base:alsa=enabled
553 -Dgst-plugins-base:typefind=enabled
554 -Dgst-plugins-base:pbtypes=enabled
555 -Dgst-full-elements=coreelements:filesrc,fakesink,identity,input-selector
556 -Dgst-full-typefind-functions=typefindfunctions:wav,flv
557 -Dgst-full-device-providers=alsa:alsadeviceprovider
558 -Dgst-full-dynamic-types=pbtypes:video_multiview_flagset
563 - meson test -C build -v test-gst-full
564 - 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"
565 - strip build/libgstreamer-full-1.0.so
566 - ls -l build/libgstreamer-full-1.0.so
574 .valgrind fedora x86_64:
575 extends: '.test fedora x86_64'
578 EXTRA_VALIDATE_ARGS: "--valgrind"
581 extends: '.valgrind fedora x86_64'
583 TEST_SUITE: "check.gstreamer\\..*"
589 - subprojects/gst-devtools/**/*
590 - subprojects/gstreamer/**/*
593 extends: '.valgrind fedora x86_64'
595 TEST_SUITE: "check.gst-plugins-base\\..*"
601 - subprojects/gst-devtools/**/*
602 - subprojects/gstreamer/**/*
603 - subprojects/gst-plugins-base/**/*
606 extends: '.valgrind fedora x86_64'
608 TEST_SUITE: "check.gst-plugins-good\\..*"
609 # take longer time due to splitmux unit test
616 - subprojects/gst-devtools/**/*
617 - subprojects/gstreamer/**/*
618 - subprojects/gst-plugins-base/**/*
619 - subprojects/gst-plugins-good/**/*
622 extends: '.valgrind fedora x86_64'
624 TEST_SUITE: "check.gst-plugins-ugly\\..*"
630 - subprojects/gst-devtools/**/*
631 - subprojects/gstreamer/**/*
632 - subprojects/gst-plugins-base/**/*
633 - subprojects/gst-plugins-good/**/*
634 - subprojects/gst-plugins-ugly/**/*
637 extends: '.valgrind fedora x86_64'
639 TEST_SUITE: "check.gst-plugins-bad\\..*"
645 - subprojects/gst-devtools/**/*
646 - subprojects/gstreamer/**/*
647 - subprojects/gst-plugins-base/**/*
648 - subprojects/gst-plugins-good/**/*
649 - subprojects/gst-plugins-bad/**/*
652 extends: '.valgrind fedora x86_64'
654 TEST_SUITE: "check.gst-editing-services\\..*"
660 - subprojects/gst-devtools/**/*
661 - subprojects/gstreamer/**/*
662 - subprojects/gst-plugins-base/**/*
663 - subprojects/gst-plugins-good/**/*
664 - subprojects/gst-plugins-bad/**/*
665 - subprojects/gst-editing-services/**/*
667 # ---- Integration ----- #
670 image: $FEDORA_DOCS_IMAGE
672 - '.build_ccache_vars'
674 MESON_ARGS: *simple_build
675 MESON_BUILDTYPE_ARGS: "-Ddoc=enabled"
676 CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
678 # FIXME: should rebuild the image with newer versions!
679 - pip3 install --upgrade hotdoc
680 - pip3 install --upgrade meson
682 - ./gst-env.py ninja -C build/ plugins_doc_caches
683 - ./ci/scripts/check-documentation-diff.py
684 - ./gst-env.py hotdoc run --conf-file=build/subprojects/gst-docs/GStreamer-doc.json --fatal-warnings
685 - mv build/subprojects/gst-docs/GStreamer-doc/html documentation/
692 - plugins-cache-diffs/
695 # This jobs runs in gstreamer namespace when after the merge into main branch.
696 # The produced artifact is later used to automatically update the web page.
704 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == "main"'
707 # This job is run in users namespace to validate documentation before merging
717 # Never run post merge, we have the `documentation` always running for that
718 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
722 - ci/gitlab/freedesktop_doc_importer.sh
724 - subprojects/gst-docs/**/*
725 - subprojects/gst-devtools/**/*
726 - subprojects/gst-editing-services/**/*
727 - subprojects/gst-libav/**/*
728 - subprojects/gst-omx/**/*
729 - subprojects/gst-plugins-bad/**/*
730 - subprojects/gst-plugins-base/**/*
731 - subprojects/gst-plugins-good/**/*
732 - subprojects/gst-plugins-ugly/**/*
733 - subprojects/gstreamer/**/*
734 - subprojects/gstreamer-vaapi/**/*
735 - subprojects/gst-rtsp-server/**/*
737 # FIXME: Using trigger: causes permission issues, workaround using old REST API.
738 # https://gitlab.com/gitlab-org/gitlab/-/issues/341737
743 - '.fdo.suffixed-image@fedora'
745 - "fedora amd64 docker"
747 - ci/gitlab/trigger_cerbero_pipeline.py
750 # Never run post merge
751 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
755 - ci/gitlab/trigger_cerbero_pipeline.py
756 - subprojects/gst-devtools/**/*
757 - subprojects/gst-editing-services/**/*
758 - subprojects/gst-libav/**/*
759 - subprojects/gst-plugins-bad/**/*
760 - subprojects/gst-plugins-base/**/*
761 - subprojects/gst-plugins-good/**/*
762 - subprojects/gst-plugins-ugly/**/*
763 - subprojects/gst-python/**/*
764 - subprojects/gstreamer/**/*
765 - subprojects/gst-rtsp-server/**/*
766 - subprojects/gst-examples/**/*