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_TAG'
94 - if: '$CI_COMMIT_BRANCH'
99 # This can be used to configure global behaviour our our jobs.
105 - 'runner_system_failure'
106 - 'stuck_or_timeout_failure'
107 - 'scheduler_failure'
111 # This is an empty job that is used to trigger the pipeline.
118 - echo "Trigger job done, now running the pipeline."
120 # If the MR is assigned to the Merge bot, trigger the pipeline automatically
121 - if: '$CI_MERGE_REQUEST_ASSIGNEES == "gstreamer-merge-bot"'
122 # Alway run tests post merged
123 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
124 # When the assignee isn't the merge bot, require an explicit action to trigger the pipeline
125 # to avoid wasting CI resources
126 - if: '$CI_MERGE_REQUEST_ASSIGNEES != "gstreamer-merge-bot"'
132 FDO_DISTRIBUTION_VERSION: '31'
133 FDO_REPO_SUFFIX: "$FEDORA_AMD64_SUFFIX"
134 FDO_DISTRIBUTION_TAG: "$FEDORA_TAG-$GST_UPSTREAM_BRANCH"
135 FDO_DISTRIBUTION_EXEC: 'DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH bash ci/docker/fedora/prepare.sh'
140 - '.fdo.container-build@fedora'
141 stage: 'build docker'
147 FDO_DISTRIBUTION_VERSION: 'stretch'
148 FDO_REPO_SUFFIX: "$INDENT_AMD64_SUFFIX"
149 FDO_DISTRIBUTION_TAG: "$INDENT_TAG-$GST_UPSTREAM_BRANCH"
150 FDO_DISTRIBUTION_PACKAGES: 'curl indent git findutils'
152 gst-indent amd64 docker:
154 - '.gst-indent image'
155 - '.fdo.container-build@debian'
156 stage: 'build docker'
157 # Do not depend on the trigger, as we want to run indent always
160 windows amd64 docker:
161 stage: "build docker"
165 # Unlike the buildah/linux jobs, this file
166 # needs to be relative to docker/windows/ subdir
167 # as it makes life easier in the powershell script
169 # We also don't need a CONTEXT_DIR var as its also
170 # hardcoded to be docker/windows/
171 DOCKERFILE: "ci/docker/windows/Dockerfile"
177 # We need to pass an array and to resolve the env vars, so we can't use a variable:
178 - $DOCKER_BUILD_ARGS = @("--build-arg", "DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH")
180 - "& ci/docker/windows/container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $WINDOWS_IMAGE $WINDOWS_UPSTREAM_IMAGE $DOCKERFILE"
183 echo "Failed to build the image"
187 .windows rust docker build:
188 stage: 'build docker'
190 - job: 'windows amd64 docker'
193 - if: '$CI_PROJECT_NAME == "gst-ci"'
195 # Unlike the buildah/linux jobs, this file
196 # needs to be relative to docker/windows/ subdir
197 # as it makes life easier in the powershell script
199 # We also don't need a CONTEXT_DIR var as its also
200 # hardcoded to be docker/windows/
201 DOCKERFILE: 'docker/windows/rust.Dockerfile'
207 # We need to pass an array and to resolve the env vars, so we can't use a variable:
208 - $DOCKER_BUILD_ARGS = @("--build-arg", "DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH", "--build-arg", "BASE_IMAGE=$WINDOWS_IMAGE", "--build-arg", "RUST_VERSION=$RUST_VERSION")
210 - $env:WINDOWS_CONTAINER_SCRIPT_PATH = "$env:CI_PROJECT_DIR\container.ps1"
211 - echo "Fetching $env:WINDOWS_CONTAINER_SCRIPT_URL"
212 - Invoke-WebRequest -Uri $env:WINDOWS_CONTAINER_SCRIPT_URL -OutFile $env:WINDOWS_CONTAINER_SCRIPT_PATH
214 - "& $env:WINDOWS_CONTAINER_SCRIPT_PATH $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $RUST_IMAGE $RUST_UPSTREAM_IMAGE $DOCKERFILE"
217 echo "Failed to build the image"
221 windows rust amd64 docker latest stable:
222 extends: '.windows rust docker build'
224 RUST_IMAGE: !reference [variables, "WINDOWS_RUST_LATEST_IMAGE"]
225 RUST_UPSTREAM_IMAGE: !reference [variables, "WINDOWS_RUST_LATEST_UPSTREAM_IMAGE"]
226 RUST_VERSION: !reference [variables, "RUST_LATEST_VERSION"]
228 windows rust amd64 docker minimum supported version:
229 extends: '.windows rust docker build'
231 RUST_IMAGE: !reference [variables, "WINDOWS_RUST_MINIMUM_IMAGE"]
232 RUST_UPSTREAM_IMAGE: !reference [variables, "WINDOWS_RUST_MINIMUM_UPSTREAM_IMAGE"]
233 RUST_VERSION: !reference [variables, "RUST_MINIMUM_VERSION"]
237 # ---- Preparation ----- #
243 - '.gst-indent image'
244 - '.fdo.suffixed-image@debian'
247 - job: 'gst-indent amd64 docker'
250 # man indent. grep RETURN VALUE, grab a beer on my behalf...
251 - indent --version || true
252 - ./scripts/gst-indent-all
254 if git diff --quiet -- ':!subprojects/gst-integration-testsuites/medias' .; then
255 echo "Code is properly formatted"
257 git diff --color=always -- ':!subprojects/gst-integration-testsuites/medias' .
258 echo 'style diverges, please run gst-indent first'
263 # build setup templates
265 .build_template: &build
268 - meson build/ $MESON_ARGS
270 - ccache --show-stats
274 CCACHE_COMPILERCHECK: 'content'
275 CCACHE_COMPRESS: 'true'
276 CCACHE_BASEDIR: '/cache/gstreamer/gstreamer'
277 CCACHE_DIR: '/cache/gstreamer/gstreamer/ccache/'
278 # shared across everything really
279 CCACHE_MAXSIZE: '10G'
280 CARGO_HOME: '/cache/gstreamer/cargo'
282 .base_modules_changes: &modules_changes
286 - subprojects/gst-devtools/**/*
287 - subprojects/gst-editing-services/**/*
288 - subprojects/gst-integration-testsuites/**/*
289 - subprojects/gst-libav/**/*
290 - subprojects/gst-omx/**/*
291 - subprojects/gst-plugins-bad/**/*
292 - subprojects/gst-plugins-base/**/*
293 - subprojects/gst-plugins-good/**/*
294 - subprojects/gst-plugins-ugly/**/*
295 - subprojects/gst-python/**/*
296 - subprojects/gstreamer/**/*
297 - subprojects/gstreamer-sharp/**/*
298 - subprojects/gstreamer-vaapi/**/*
299 - subprojects/gst-rtsp-server/**/*
301 .simple_fedora_build: &simple_build >-
302 ${DEFAULT_MESON_ARGS}
305 -Dgst-omx:target=generic
308 ${MESON_BUILDTYPE_ARGS}
314 - '.build_ccache_vars'
317 # Taking into account the slowest shared runner + time needed to upload the binaries to artifacts
318 # Also need to take into account I/O of pulling docker images and uploading artifacts
321 MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
323 - export RUSTUP_HOME="/usr/local/rustup"
324 - export CARGO_HOME="/usr/local/cargo"
325 - export PATH="/usr/local/cargo/bin:$PATH"
327 - ci/scripts/handle-subprojects-cache.py subprojects/
328 # Update subprojects to respect `.wrap` content
329 - meson subprojects update --reset
333 - mv build/meson-logs/ meson-logs
340 # If this matches, it means the pipeline is running against either the main
341 # or a stable branch, so make it manual
342 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
347 .build fedora x86_64:
350 - '.fdo.suffixed-image@fedora'
353 - "fedora amd64 docker"
355 MESON_ARGS: *simple_build
357 build nodebug fedora x86_64:
360 - '.fdo.suffixed-image@fedora'
363 - "fedora amd64 docker"
365 MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
367 build clang fedora x86_64:
368 extends: '.build fedora x86_64'
371 CXX: 'ccache clang++'
374 image: $WINDOWS_IMAGE
381 - "windows amd64 docker"
385 ${DEFAULT_MESON_ARGS}
389 -Dgst-plugins-base:pango=enabled
390 -Dgst-plugins-good:cairo=enabled
392 # If this matches, it means the pipeline is running against either the main
393 # or a stable branch, so make it manual
394 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
399 - ci/scripts/handle-subprojects-cache.py subprojects/
401 # For some reason, options are separated by newline instead of space, so we
402 # have to replace them first.
403 - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
404 - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
405 meson build $env:MESON_ARGS &&
407 # XXX: Re-enable when uploading stops timing out
409 # expire_in: "7 days"
412 # - 'build/meson-logs/'
415 extends: '.build windows'
420 extends: '.build windows'
425 extends: '.build windows'
433 # Make sure powershell exits on errors
434 # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
435 - $ErrorActionPreference = "Stop"
437 # Configure MSYS2 to use the UCRT64 environment, start in the same directory
439 - $env:MSYSTEM = "UCRT64"
440 - $env:CHERE_INVOKING = "1"
441 - $env:MSYS2_PATH_TYPE = "inherit"
442 # For some reason, options are separated by newline instead of space, so we
443 # have to replace them first.
444 - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
445 # Replace forward slashes with backwards so bash doesn't complain
446 - $env:_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\','/')
447 - C:\msys64\usr\bin\bash -lc "meson build $env:MESON_ARGS && ninja -C build"
454 - '.build_ccache_vars'
458 MESON_ARGS: *simple_build
460 # Disable colored output to avoid weird rendering issues
461 GST_DEBUG_NO_COLOR: "true"
462 CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/validate-logs/"
463 GST_VALIDATE_LAUNCHER_FORCE_COLORS: "true"
465 CARGO_HOME: "/cache/gstreamer/cargo"
466 # Enable the fault handler so we get backtraces on segfaults.
467 # any non-empty string will do
468 PYTHONFAULTHANDLER: "enabled"
475 - echo "-> Running ${TEST_SUITE}"
478 gst-validate-launcher ${TEST_SUITE}
485 --timeout-factor "${TIMEOUT_FACTOR}"
486 --fail-on-testlist-change
487 -l "${CI_PROJECT_DIR}/validate-logs/"
488 --xunit-file "${CI_PROJECT_DIR}/validate-logs/xunit.xml"
489 ${EXTRA_VALIDATE_ARGS}
491 - mv build/meson-logs/ meson-logs
500 - "validate-logs/*.xml"
505 - '.fdo.suffixed-image@fedora'
508 - "fedora amd64 docker"
512 extends: '.test fedora x86_64'
514 TEST_SUITE: "check.gst*"
516 integration testsuites fedora:
517 extends: '.test fedora x86_64'
520 EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX} --sync"
521 TEST_SUITE: "validate ges"
524 gstreamer-full static build:
525 extends: '.build fedora x86_64'
529 --default-library=static
535 - meson test -C build -v test-gst-full
542 gstreamer-full-minimal static build:
543 extends: 'gstreamer-full static build'
547 --default-library=static
549 -Dgstreamer:gst_debug=false
550 -Dauto_features=disabled
551 -Dgstreamer:check=enabled
553 -Dgst-plugins-base:alsa=enabled
554 -Dgst-plugins-base:typefind=enabled
555 -Dgst-plugins-base:pbtypes=enabled
556 -Dgst-full-elements=coreelements:filesrc,fakesink,identity,input-selector
557 -Dgst-full-typefind-functions=typefindfunctions:wav,flv
558 -Dgst-full-device-providers=alsa:alsadeviceprovider
559 -Dgst-full-dynamic-types=pbtypes:video_multiview_flagset
564 - meson test -C build -v test-gst-full
565 - 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"
566 - strip build/libgstreamer-full-1.0.so
567 - ls -l build/libgstreamer-full-1.0.so
575 .valgrind fedora x86_64:
576 extends: '.test fedora x86_64'
579 EXTRA_VALIDATE_ARGS: "--valgrind"
582 extends: '.valgrind fedora x86_64'
584 TEST_SUITE: "check.gstreamer\\..*"
590 - subprojects/gst-devtools/**/*
591 - subprojects/gstreamer/**/*
594 extends: '.valgrind fedora x86_64'
596 TEST_SUITE: "check.gst-plugins-base\\..*"
602 - subprojects/gst-devtools/**/*
603 - subprojects/gstreamer/**/*
604 - subprojects/gst-plugins-base/**/*
607 extends: '.valgrind fedora x86_64'
609 TEST_SUITE: "check.gst-plugins-good\\..*"
610 # take longer time due to splitmux unit test
617 - subprojects/gst-devtools/**/*
618 - subprojects/gstreamer/**/*
619 - subprojects/gst-plugins-base/**/*
620 - subprojects/gst-plugins-good/**/*
623 extends: '.valgrind fedora x86_64'
625 TEST_SUITE: "check.gst-plugins-ugly\\..*"
631 - subprojects/gst-devtools/**/*
632 - subprojects/gstreamer/**/*
633 - subprojects/gst-plugins-base/**/*
634 - subprojects/gst-plugins-good/**/*
635 - subprojects/gst-plugins-ugly/**/*
638 extends: '.valgrind fedora x86_64'
640 TEST_SUITE: "check.gst-plugins-bad\\..*"
646 - subprojects/gst-devtools/**/*
647 - subprojects/gstreamer/**/*
648 - subprojects/gst-plugins-base/**/*
649 - subprojects/gst-plugins-good/**/*
650 - subprojects/gst-plugins-bad/**/*
653 extends: '.valgrind fedora x86_64'
655 TEST_SUITE: "check.gst-editing-services\\..*"
661 - subprojects/gst-devtools/**/*
662 - subprojects/gstreamer/**/*
663 - subprojects/gst-plugins-base/**/*
664 - subprojects/gst-plugins-good/**/*
665 - subprojects/gst-plugins-bad/**/*
666 - subprojects/gst-editing-services/**/*
668 # ---- Integration ----- #
671 image: $FEDORA_DOCS_IMAGE
673 - '.build_ccache_vars'
675 MESON_ARGS: *simple_build
676 MESON_BUILDTYPE_ARGS: "-Ddoc=enabled"
677 CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
679 # FIXME: should rebuild the image with newer versions!
680 - pip3 install --upgrade hotdoc
681 - pip3 install --upgrade meson
683 - ./gst-env.py ninja -C build/ plugins_doc_caches
684 - ./ci/scripts/check-documentation-diff.py
685 - ./gst-env.py hotdoc run --conf-file=build/subprojects/gst-docs/GStreamer-doc.json --fatal-warnings
686 - mv build/subprojects/gst-docs/GStreamer-doc/html documentation/
693 - plugins-cache-diffs/
696 # This jobs runs in gstreamer namespace when after the merge into main branch.
697 # The produced artifact is later used to automatically update the web page.
705 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == "main"'
708 # This job is run in users namespace to validate documentation before merging
718 # Never run post merge, we have the `documentation` always running for that
719 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
723 - ci/gitlab/freedesktop_doc_importer.sh
725 - subprojects/gst-docs/**/*
726 - subprojects/gst-devtools/**/*
727 - subprojects/gst-editing-services/**/*
728 - subprojects/gst-libav/**/*
729 - subprojects/gst-omx/**/*
730 - subprojects/gst-plugins-bad/**/*
731 - subprojects/gst-plugins-base/**/*
732 - subprojects/gst-plugins-good/**/*
733 - subprojects/gst-plugins-ugly/**/*
734 - subprojects/gstreamer/**/*
735 - subprojects/gstreamer-vaapi/**/*
736 - subprojects/gst-rtsp-server/**/*
738 # FIXME: Using trigger: causes permission issues, workaround using old REST API.
739 # https://gitlab.com/gitlab-org/gitlab/-/issues/341737
744 - '.fdo.suffixed-image@fedora'
746 - "fedora amd64 docker"
748 - ci/gitlab/trigger_cerbero_pipeline.py
751 # Never run post merge
752 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
756 - ci/gitlab/trigger_cerbero_pipeline.py
757 - subprojects/gst-devtools/**/*
758 - subprojects/gst-editing-services/**/*
759 - subprojects/gst-libav/**/*
760 - subprojects/gst-plugins-bad/**/*
761 - subprojects/gst-plugins-base/**/*
762 - subprojects/gst-plugins-good/**/*
763 - subprojects/gst-plugins-ugly/**/*
764 - subprojects/gst-python/**/*
765 - subprojects/gstreamer/**/*
766 - subprojects/gst-rtsp-server/**/*
767 - subprojects/gst-examples/**/*