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
16 # Branch to track for modules that have no ref specified in the manifest
17 GST_UPSTREAM_BRANCH: 'main'
18 ORC_UPSTREAM_BRANCH: 'master'
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.
26 FEDORA_TAG: '2021-10-05.0'
27 INDENT_TAG: '2021-10-04.0'
28 WINDOWS_TAG: "2021-10-12.0"
30 GST_UPSTREAM_REPO: 'gstreamer/gstreamer'
31 FDO_UPSTREAM_REPO: 'gstreamer/gstreamer'
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'
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"
42 RUST_MINIMUM_VERSION: '1.54.0'
43 RUST_LATEST_VERSION: '1.55.0'
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"
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"
51 MESON_BUILDTYPE_ARGS: --default-library=both
53 -Dlibnice:tests=disabled
54 -Dlibnice:examples=disabled
55 -Dopenh264:tests=disabled
56 -Dpygobject:tests=false
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
79 -Dgst-devtools:werror=true
80 -Dgst-python:werror=true
81 -Dgstreamer-vaapi:werror=true
82 -Dgstreamer-sharp:werror=true
85 # https://docs.gitlab.com/ee/ci/yaml/index.html#switch-between-branch-pipelines-and-merge-request-pipelines
87 - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
88 - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
90 - if: '$CI_COMMIT_BRANCH'
95 # This can be used to configure global behaviour our our jobs.
101 - 'runner_system_failure'
102 - 'stuck_or_timeout_failure'
103 - 'scheduler_failure'
107 # This is an empty job that is used to trigger the pipeline.
112 - echo "Trigger job done, now running the pipeline."
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"'
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'
134 - '.fdo.container-build@fedora'
135 stage: 'build docker'
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'
146 gst-indent amd64 docker:
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
154 windows amd64 docker:
155 stage: "build docker"
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
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"
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")
174 - "& ci/docker/windows/container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $WINDOWS_IMAGE $WINDOWS_UPSTREAM_IMAGE $DOCKERFILE"
177 echo "Failed to build the image"
181 .windows rust docker build:
182 stage: 'build docker'
184 - job: 'windows amd64 docker'
187 - if: '$CI_PROJECT_NAME == "gst-ci"'
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
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'
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")
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
208 - "& $env:WINDOWS_CONTAINER_SCRIPT_PATH $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $RUST_IMAGE $RUST_UPSTREAM_IMAGE $DOCKERFILE"
211 echo "Failed to build the image"
215 windows rust amd64 docker latest stable:
216 extends: '.windows rust docker build'
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"]
222 windows rust amd64 docker minimum supported version:
223 extends: '.windows rust docker build'
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"]
231 # ---- Preparation ----- #
237 - '.gst-indent image'
238 - '.fdo.suffixed-image@debian'
241 - job: 'gst-indent amd64 docker'
244 # man indent. grep RETURN VALUE, grab a beer on my behalf...
245 - indent --version || true
246 - ./scripts/gst-indent-all
248 if git diff --quiet -- ':!subprojects/gst-integration-testsuites/medias' .; then
249 echo "Code is properly formatted"
251 git diff --color=always -- ':!subprojects/gst-integration-testsuites/medias' .
252 echo 'style diverges, please run gst-indent first'
257 # build setup templates
259 .build_template: &build
262 - meson build/ $MESON_ARGS
264 - ccache --show-stats
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'
276 .base_modules_changes: &modules_changes
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/**/*
295 .simple_fedora_build: &simple_build >-
296 ${DEFAULT_MESON_ARGS}
299 -Dgst-omx:target=generic
302 ${MESON_BUILDTYPE_ARGS}
308 - '.build_ccache_vars'
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
315 MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
317 - export RUSTUP_HOME="/usr/local/rustup"
318 - export CARGO_HOME="/usr/local/cargo"
319 - export PATH="/usr/local/cargo/bin:$PATH"
321 - ci/scripts/handle-subprojects-cache.py subprojects/
322 # Update subprojects to respect `.wrap` content
323 - meson subprojects update --reset
327 - mv build/meson-logs/ meson-logs
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'
341 .build fedora x86_64:
344 - '.fdo.suffixed-image@fedora'
347 - "fedora amd64 docker"
349 MESON_ARGS: *simple_build
351 build nodebug fedora x86_64:
354 - '.fdo.suffixed-image@fedora'
357 - "fedora amd64 docker"
359 MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
361 build static fedora x86_64:
362 extends: '.build fedora x86_64'
364 MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
366 build static nodebug fedora x86_64:
367 extends: 'build nodebug fedora x86_64'
369 MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
371 build clang fedora x86_64:
372 extends: '.build fedora x86_64'
375 CXX: 'ccache clang++'
378 image: $WINDOWS_IMAGE
385 - "windows amd64 docker"
389 ${DEFAULT_MESON_ARGS}
393 -Dgst-plugins-base:pango=enabled
394 -Dgst-plugins-good:cairo=enabled
396 # If this matches, it means the pipeline is running against either the main
397 # or a stable branch, so make it manual
398 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
403 - ci/scripts/handle-subprojects-cache.py subprojects/
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 &&
411 # XXX: Re-enable when uploading stops timing out
413 # expire_in: "7 days"
416 # - 'build/meson-logs/'
419 extends: '.build windows'
424 extends: '.build windows'
429 extends: '.build windows'
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"
441 # Configure MSYS2 to use the UCRT64 environment, start in the same directory
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"
458 - '.build_ccache_vars'
462 MESON_ARGS: *simple_build
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"
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"
479 - echo "-> Running ${TEST_SUITE}"
482 gst-validate-launcher ${TEST_SUITE}
489 --timeout-factor "${TIMEOUT_FACTOR}"
490 --fail-on-testlist-change
491 -l "${CI_PROJECT_DIR}/validate-logs/"
492 --xunit-file "${CI_PROJECT_DIR}/validate-logs/xunit.xml"
493 ${EXTRA_VALIDATE_ARGS}
495 - mv build/meson-logs/ meson-logs
504 - "validate-logs/*.xml"
509 - '.fdo.suffixed-image@fedora'
512 - "fedora amd64 docker"
516 extends: '.test fedora x86_64'
518 TEST_SUITE: "check.gst*"
520 integration testsuites fedora:
521 extends: '.test fedora x86_64'
524 EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX} --sync"
525 TEST_SUITE: "validate ges"
528 # introspection has been disabled as the static build does not support it.
529 # See https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/162
531 extends: 'build static fedora x86_64'
535 --default-library=static
536 -Dintrospection=disabled
539 # If this matches, it means the pipeline is running against either the main
540 # or a stable branch, so make it manual
541 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
550 - meson test -C build -v test-gst-full
557 gstreamer-full-minimal:
558 extends: 'build static fedora x86_64'
562 --default-library=static
563 -Dauto_features=disabled
564 -Dgstreamer:check=enabled
566 -Dgst-plugins-base:alsa=enabled
567 -Dgst-plugins-base:typefind=enabled
568 -Dgst-plugins-base:pbtypes=enabled
569 -Dgst-full-elements=coreelements:filesrc,fakesink,identity,input-selector
570 -Dgst-full-typefind-functions=typefindfunctions:wav,flv
571 -Dgst-full-device-providers=alsa:alsadeviceprovider
572 -Dgst-full-dynamic-types=pbtypes:video_multiview_flagset
577 - meson test -C build -v test-gst-full
578 - 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"
579 - strip build/libgstreamer-full-1.0.so
580 - ls -l build/libgstreamer-full-1.0.so
588 .valgrind fedora x86_64:
589 extends: '.test fedora x86_64'
592 EXTRA_VALIDATE_ARGS: "--valgrind"
595 extends: '.valgrind fedora x86_64'
598 TEST_SUITE: "check.gstreamer\\..*"
599 EXTRA_VALIDATE_ARGS: "--valgrind --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX}"
605 - subprojects/gst-devtools/**/*
606 - subprojects/gstreamer/**/*
609 extends: '.valgrind fedora x86_64'
612 TEST_SUITE: "check.gst-plugins-base\\..*"
613 EXTRA_VALIDATE_ARGS: "--valgrind --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX}"
619 - subprojects/gst-devtools/**/*
620 - subprojects/gstreamer/**/*
621 - subprojects/gst-plugins-base/**/*
624 extends: '.valgrind fedora x86_64'
626 TEST_SUITE: "check.gst-plugins-good\\..*"
627 # take longer time due to splitmux unit test
634 - subprojects/gst-devtools/**/*
635 - subprojects/gstreamer/**/*
636 - subprojects/gst-plugins-base/**/*
637 - subprojects/gst-plugins-good/**/*
640 extends: '.valgrind fedora x86_64'
642 TEST_SUITE: "check.gst-plugins-ugly\\..*"
648 - subprojects/gst-devtools/**/*
649 - subprojects/gstreamer/**/*
650 - subprojects/gst-plugins-base/**/*
651 - subprojects/gst-plugins-good/**/*
652 - subprojects/gst-plugins-ugly/**/*
655 extends: '.valgrind fedora x86_64'
657 TEST_SUITE: "check.gst-plugins-bad\\..*"
663 - subprojects/gst-devtools/**/*
664 - subprojects/gstreamer/**/*
665 - subprojects/gst-plugins-base/**/*
666 - subprojects/gst-plugins-good/**/*
667 - subprojects/gst-plugins-bad/**/*
670 extends: '.valgrind fedora x86_64'
672 TEST_SUITE: "check.gst-editing-services\\..*"
678 - subprojects/gst-devtools/**/*
679 - subprojects/gstreamer/**/*
680 - subprojects/gst-plugins-base/**/*
681 - subprojects/gst-plugins-good/**/*
682 - subprojects/gst-plugins-bad/**/*
683 - subprojects/gst-editing-services/**/*
685 # ---- Integration ----- #
688 image: $FEDORA_DOCS_IMAGE
690 - '.build_ccache_vars'
692 MESON_ARGS: *simple_build
693 MESON_BUILDTYPE_ARGS: "-Ddoc=enabled"
694 CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
696 - pip3 install --upgrade hotdoc
698 - ./gst-env.py ninja -C build/ plugins_doc_caches
699 - ./ci/scripts/check-documentation-diff.py
700 - ./gst-env.py hotdoc run --conf-file=build/subprojects/gst-docs/GStreamer-doc.json --fatal-warnings
701 - mv build/subprojects/gst-docs/GStreamer-doc/html documentation/
708 - plugins-cache-diffs/
711 # This jobs runs in gstreamer namespace when after the merge into main branch.
712 # The produced artifact is later used to automatically update the web page.
720 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == "main"'
723 # This job is run in users namespace to validate documentation before merging
733 # Never run post merge, we have the `documentation` always running for that
734 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
738 - ci/gitlab/freedesktop_doc_importer.sh
740 - subprojects/gst-docs/**/*
741 - subprojects/gst-devtools/**/*
742 - subprojects/gst-editing-services/**/*
743 - subprojects/gst-libav/**/*
744 - subprojects/gst-omx/**/*
745 - subprojects/gst-plugins-bad/**/*
746 - subprojects/gst-plugins-base/**/*
747 - subprojects/gst-plugins-good/**/*
748 - subprojects/gst-plugins-ugly/**/*
749 - subprojects/gstreamer/**/*
750 - subprojects/gstreamer-vaapi/**/*
751 - subprojects/gst-rtsp-server/**/*
753 # FIXME: Using trigger: causes permission issues, workaround using old REST API.
754 # https://gitlab.com/gitlab-org/gitlab/-/issues/341737
759 - '.fdo.suffixed-image@fedora'
761 - "fedora amd64 docker"
763 - ci/gitlab/trigger_cerbero_pipeline.py
766 # Never run post merge
767 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
771 - ci/gitlab/trigger_cerbero_pipeline.py
772 - subprojects/gst-devtools/**/*
773 - subprojects/gst-editing-services/**/*
774 - subprojects/gst-libav/**/*
775 - subprojects/gst-plugins-bad/**/*
776 - subprojects/gst-plugins-base/**/*
777 - subprojects/gst-plugins-good/**/*
778 - subprojects/gst-plugins-ugly/**/*
779 - subprojects/gst-python/**/*
780 - subprojects/gstreamer/**/*
781 - subprojects/gst-rtsp-server/**/*
782 - subprojects/gst-examples/**/*