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
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
80 -Dgst-devtools:werror=true
81 -Dgst-python:werror=true
82 -Dgstreamer-vaapi:werror=true
83 -Dgstreamer-sharp:werror=true
86 # https://docs.gitlab.com/ee/ci/yaml/index.html#switch-between-branch-pipelines-and-merge-request-pipelines
88 - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
89 - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
91 - if: '$CI_COMMIT_BRANCH'
96 # This can be used to configure global behaviour our our jobs.
102 - 'runner_system_failure'
103 - 'stuck_or_timeout_failure'
104 - 'scheduler_failure'
108 # This is an empty job that is used to trigger the pipeline.
113 - echo "Trigger job done, now running the pipeline."
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"'
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'
135 - '.fdo.container-build@fedora'
136 stage: 'build docker'
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'
147 gst-indent amd64 docker:
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
155 windows amd64 docker:
156 stage: "build docker"
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
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"
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")
175 - "& ci/docker/windows/container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $WINDOWS_IMAGE $WINDOWS_UPSTREAM_IMAGE $DOCKERFILE"
178 echo "Failed to build the image"
182 .windows rust docker build:
183 stage: 'build docker'
185 - job: 'windows amd64 docker'
188 - if: '$CI_PROJECT_NAME == "gst-ci"'
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
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'
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")
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
209 - "& $env:WINDOWS_CONTAINER_SCRIPT_PATH $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $RUST_IMAGE $RUST_UPSTREAM_IMAGE $DOCKERFILE"
212 echo "Failed to build the image"
216 windows rust amd64 docker latest stable:
217 extends: '.windows rust docker build'
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"]
223 windows rust amd64 docker minimum supported version:
224 extends: '.windows rust docker build'
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"]
232 # ---- Preparation ----- #
238 - '.gst-indent image'
239 - '.fdo.suffixed-image@debian'
242 - job: 'gst-indent amd64 docker'
245 # man indent. grep RETURN VALUE, grab a beer on my behalf...
246 - indent --version || true
247 - ./scripts/gst-indent-all
249 if git diff --quiet -- ':!subprojects/gst-integration-testsuites/medias' .; then
250 echo "Code is properly formatted"
252 git diff --color=always -- ':!subprojects/gst-integration-testsuites/medias' .
253 echo 'style diverges, please run gst-indent first'
258 # build setup templates
260 .build_template: &build
263 - meson build/ $MESON_ARGS
265 - ccache --show-stats
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'
277 .base_modules_changes: &modules_changes
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/**/*
296 .simple_fedora_build: &simple_build >-
297 ${DEFAULT_MESON_ARGS}
300 -Dgst-omx:target=generic
303 ${MESON_BUILDTYPE_ARGS}
309 - '.build_ccache_vars'
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
316 MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
318 - export RUSTUP_HOME="/usr/local/rustup"
319 - export CARGO_HOME="/usr/local/cargo"
320 - export PATH="/usr/local/cargo/bin:$PATH"
322 - ci/scripts/handle-subprojects-cache.py subprojects/
323 # Update subprojects to respect `.wrap` content
324 - meson subprojects update --reset
328 - mv build/meson-logs/ meson-logs
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'
342 .build fedora x86_64:
345 - '.fdo.suffixed-image@fedora'
348 - "fedora amd64 docker"
350 MESON_ARGS: *simple_build
352 build nodebug fedora x86_64:
355 - '.fdo.suffixed-image@fedora'
358 - "fedora amd64 docker"
360 MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
362 build static fedora x86_64:
363 extends: '.build fedora x86_64'
365 MESON_BUILDTYPE_ARGS: >
366 --default-library=static
367 -Dintrospection=disabled
371 build static nodebug fedora x86_64:
372 extends: 'build nodebug fedora x86_64'
374 MESON_BUILDTYPE_ARGS: >
375 --default-library=static
376 -Dintrospection=disabled
380 build clang fedora x86_64:
381 extends: '.build fedora x86_64'
384 CXX: 'ccache clang++'
387 image: $WINDOWS_IMAGE
394 - "windows amd64 docker"
398 ${DEFAULT_MESON_ARGS}
402 -Dgst-plugins-base:pango=enabled
403 -Dgst-plugins-good:cairo=enabled
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'
412 - ci/scripts/handle-subprojects-cache.py subprojects/
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 &&
420 # XXX: Re-enable when uploading stops timing out
422 # expire_in: "7 days"
425 # - 'build/meson-logs/'
428 extends: '.build windows'
433 extends: '.build windows'
438 extends: '.build windows'
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"
450 # Configure MSYS2 to use the UCRT64 environment, start in the same directory
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"
467 - '.build_ccache_vars'
471 MESON_ARGS: *simple_build
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"
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"
488 - echo "-> Running ${TEST_SUITE}"
491 gst-validate-launcher ${TEST_SUITE}
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}
504 - mv build/meson-logs/ meson-logs
513 - "validate-logs/*.xml"
518 - '.fdo.suffixed-image@fedora'
521 - "fedora amd64 docker"
525 extends: '.test fedora x86_64'
527 TEST_SUITE: "check.gst*"
529 integration testsuites fedora:
530 extends: '.test fedora x86_64'
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"
538 extends: 'build static fedora x86_64'
542 --default-library=static
548 - meson test -C build -v test-gst-full
555 gstreamer-full-minimal:
556 extends: 'build static fedora x86_64'
560 --default-library=static
561 -Dauto_features=disabled
562 -Dgstreamer:check=enabled
564 -Dgst-plugins-base:alsa=enabled
565 -Dgst-plugins-base:typefind=enabled
566 -Dgst-plugins-base:pbtypes=enabled
567 -Dgst-full-elements=coreelements:filesrc,fakesink,identity,input-selector
568 -Dgst-full-typefind-functions=typefindfunctions:wav,flv
569 -Dgst-full-device-providers=alsa:alsadeviceprovider
570 -Dgst-full-dynamic-types=pbtypes:video_multiview_flagset
575 - meson test -C build -v test-gst-full
576 - 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"
577 - strip build/libgstreamer-full-1.0.so
578 - ls -l build/libgstreamer-full-1.0.so
586 .valgrind fedora x86_64:
587 extends: '.test fedora x86_64'
590 EXTRA_VALIDATE_ARGS: "--valgrind"
593 extends: '.valgrind fedora x86_64'
596 TEST_SUITE: "check.gstreamer\\..*"
597 EXTRA_VALIDATE_ARGS: "--valgrind --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX}"
603 - subprojects/gst-devtools/**/*
604 - subprojects/gstreamer/**/*
607 extends: '.valgrind fedora x86_64'
610 TEST_SUITE: "check.gst-plugins-base\\..*"
611 EXTRA_VALIDATE_ARGS: "--valgrind --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX}"
617 - subprojects/gst-devtools/**/*
618 - subprojects/gstreamer/**/*
619 - subprojects/gst-plugins-base/**/*
622 extends: '.valgrind fedora x86_64'
624 TEST_SUITE: "check.gst-plugins-good\\..*"
625 # take longer time due to splitmux unit test
632 - subprojects/gst-devtools/**/*
633 - subprojects/gstreamer/**/*
634 - subprojects/gst-plugins-base/**/*
635 - subprojects/gst-plugins-good/**/*
638 extends: '.valgrind fedora x86_64'
640 TEST_SUITE: "check.gst-plugins-ugly\\..*"
646 - subprojects/gst-devtools/**/*
647 - subprojects/gstreamer/**/*
648 - subprojects/gst-plugins-base/**/*
649 - subprojects/gst-plugins-good/**/*
650 - subprojects/gst-plugins-ugly/**/*
653 extends: '.valgrind fedora x86_64'
655 TEST_SUITE: "check.gst-plugins-bad\\..*"
661 - subprojects/gst-devtools/**/*
662 - subprojects/gstreamer/**/*
663 - subprojects/gst-plugins-base/**/*
664 - subprojects/gst-plugins-good/**/*
665 - subprojects/gst-plugins-bad/**/*
668 extends: '.valgrind fedora x86_64'
670 TEST_SUITE: "check.gst-editing-services\\..*"
676 - subprojects/gst-devtools/**/*
677 - subprojects/gstreamer/**/*
678 - subprojects/gst-plugins-base/**/*
679 - subprojects/gst-plugins-good/**/*
680 - subprojects/gst-plugins-bad/**/*
681 - subprojects/gst-editing-services/**/*
683 # ---- Integration ----- #
686 image: $FEDORA_DOCS_IMAGE
688 - '.build_ccache_vars'
690 MESON_ARGS: *simple_build
691 MESON_BUILDTYPE_ARGS: "-Ddoc=enabled"
692 CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
694 # FIXME: should rebuild the image with newer versions!
695 - pip3 install --upgrade hotdoc
696 - pip3 install --upgrade meson
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/**/*