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-12-03.1'
29 INDENT_TAG: '2021-10-04.0'
30 WINDOWS_TAG: "2022-01-26.3"
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"'
92 GIT_FETCH_EXTRA_FLAGS: '--no-tags'
93 - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
95 - if: '$CI_COMMIT_TAG'
96 - if: '$CI_COMMIT_BRANCH'
98 GIT_FETCH_EXTRA_FLAGS: '--no-tags'
103 # This can be used to configure global behaviour our our jobs.
109 - 'runner_system_failure'
110 - 'stuck_or_timeout_failure'
111 - 'scheduler_failure'
115 # This is an empty job that is used to trigger the pipeline.
122 - echo "Trigger job done, now running the pipeline."
124 # If the MR is assigned to the Merge bot, trigger the pipeline automatically
125 - if: '$CI_MERGE_REQUEST_ASSIGNEES == "gstreamer-merge-bot"'
126 # Alway run tests post merged
127 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
128 # When the assignee isn't the merge bot, require an explicit action to trigger the pipeline
129 # to avoid wasting CI resources
130 - if: '$CI_MERGE_REQUEST_ASSIGNEES != "gstreamer-merge-bot"'
136 FDO_DISTRIBUTION_VERSION: '31'
137 FDO_REPO_SUFFIX: "$FEDORA_AMD64_SUFFIX"
138 FDO_DISTRIBUTION_TAG: "$FEDORA_TAG-$GST_UPSTREAM_BRANCH"
139 FDO_DISTRIBUTION_EXEC: 'GIT_BRANCH=$CI_COMMIT_REF_NAME GIT_URL=$CI_REPOSITORY_URL bash ci/docker/fedora/prepare.sh'
144 - '.fdo.container-build@fedora'
145 stage: 'build docker'
153 FDO_DISTRIBUTION_VERSION: 'stretch'
154 FDO_REPO_SUFFIX: "$INDENT_AMD64_SUFFIX"
155 FDO_DISTRIBUTION_TAG: "$INDENT_TAG-$GST_UPSTREAM_BRANCH"
156 FDO_DISTRIBUTION_PACKAGES: 'curl indent git findutils'
158 gst-indent amd64 docker:
160 - '.gst-indent image'
161 - '.fdo.container-build@debian'
162 stage: 'build docker'
163 # Do not depend on the trigger, as we want to run indent always
166 windows amd64 docker:
167 stage: "build docker"
171 # Unlike the buildah/linux jobs, this file
172 # needs to be relative to docker/windows/ subdir
173 # as it makes life easier in the powershell script
175 # We also don't need a CONTEXT_DIR var as its also
176 # hardcoded to be docker/windows/
177 DOCKERFILE: "ci/docker/windows/Dockerfile"
183 # We need to pass an array and to resolve the env vars, so we can't use a variable:
184 - $DOCKER_BUILD_ARGS = @("--build-arg", "DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH")
186 - "& ci/docker/windows/container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $WINDOWS_IMAGE $WINDOWS_UPSTREAM_IMAGE $DOCKERFILE"
189 echo "Failed to build the image"
193 .windows rust docker build:
194 stage: 'build docker'
196 - job: 'windows amd64 docker'
199 - if: '$CI_PROJECT_NAME == "gst-ci"'
201 # Unlike the buildah/linux jobs, this file
202 # needs to be relative to docker/windows/ subdir
203 # as it makes life easier in the powershell script
205 # We also don't need a CONTEXT_DIR var as its also
206 # hardcoded to be docker/windows/
207 DOCKERFILE: 'docker/windows/rust.Dockerfile'
213 # We need to pass an array and to resolve the env vars, so we can't use a variable:
214 - $DOCKER_BUILD_ARGS = @("--build-arg", "DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH", "--build-arg", "BASE_IMAGE=$WINDOWS_IMAGE", "--build-arg", "RUST_VERSION=$RUST_VERSION")
216 - $env:WINDOWS_CONTAINER_SCRIPT_PATH = "$env:CI_PROJECT_DIR\container.ps1"
217 - echo "Fetching $env:WINDOWS_CONTAINER_SCRIPT_URL"
218 - Invoke-WebRequest -Uri $env:WINDOWS_CONTAINER_SCRIPT_URL -OutFile $env:WINDOWS_CONTAINER_SCRIPT_PATH
220 - "& $env:WINDOWS_CONTAINER_SCRIPT_PATH $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $RUST_IMAGE $RUST_UPSTREAM_IMAGE $DOCKERFILE"
223 echo "Failed to build the image"
227 windows rust amd64 docker latest stable:
228 extends: '.windows rust docker build'
230 RUST_IMAGE: !reference [variables, "WINDOWS_RUST_LATEST_IMAGE"]
231 RUST_UPSTREAM_IMAGE: !reference [variables, "WINDOWS_RUST_LATEST_UPSTREAM_IMAGE"]
232 RUST_VERSION: !reference [variables, "RUST_LATEST_VERSION"]
234 windows rust amd64 docker minimum supported version:
235 extends: '.windows rust docker build'
237 RUST_IMAGE: !reference [variables, "WINDOWS_RUST_MINIMUM_IMAGE"]
238 RUST_UPSTREAM_IMAGE: !reference [variables, "WINDOWS_RUST_MINIMUM_UPSTREAM_IMAGE"]
239 RUST_VERSION: !reference [variables, "RUST_MINIMUM_VERSION"]
243 # ---- Preparation ----- #
249 - '.gst-indent image'
250 - '.fdo.suffixed-image@debian'
253 - job: 'gst-indent amd64 docker'
256 # man indent. grep RETURN VALUE, grab a beer on my behalf...
257 - indent --version || true
258 - ./scripts/gst-indent-all
260 if git diff --quiet -- ':!subprojects/gst-integration-testsuites/medias' .; then
261 echo "Code is properly formatted"
263 git diff --color=always -- ':!subprojects/gst-integration-testsuites/medias' .
264 echo 'style diverges, please run gst-indent first'
269 # build setup templates
271 .build_template: &build
272 - ci/scripts/handle-subprojects-cache.py subprojects/
273 # Update subprojects to respect `.wrap` content
274 - meson subprojects update --reset
276 - meson build/ $MESON_ARGS
278 - ccache --show-stats
282 CCACHE_COMPILERCHECK: 'content'
283 CCACHE_COMPRESS: 'true'
284 CCACHE_BASEDIR: '/cache/gstreamer/gstreamer'
285 CCACHE_DIR: '/cache/gstreamer/gstreamer/ccache/'
286 # shared across everything really
287 CCACHE_MAXSIZE: '10G'
288 CARGO_HOME: '/cache/gstreamer/cargo'
290 .base_modules_changes: &modules_changes
294 - subprojects/gst-devtools/**/*
295 - subprojects/gst-editing-services/**/*
296 - subprojects/gst-integration-testsuites/**/*
297 - subprojects/gst-libav/**/*
298 - subprojects/gst-omx/**/*
299 - subprojects/gst-plugins-bad/**/*
300 - subprojects/gst-plugins-base/**/*
301 - subprojects/gst-plugins-good/**/*
302 - subprojects/gst-plugins-ugly/**/*
303 - subprojects/gst-python/**/*
304 - subprojects/gstreamer/**/*
305 - subprojects/gstreamer-sharp/**/*
306 - subprojects/gstreamer-vaapi/**/*
307 - subprojects/gst-rtsp-server/**/*
309 .simple_fedora_build: &simple_build >-
310 ${DEFAULT_MESON_ARGS}
313 -Dgst-omx:target=generic
316 ${MESON_BUILDTYPE_ARGS}
322 - '.build_ccache_vars'
325 # Taking into account the slowest shared runner + time needed to upload the binaries to artifacts
326 # Also need to take into account I/O of pulling docker images and uploading artifacts
329 MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
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
391 # Needs to not be empty otherwise the newline -> space replace command in
392 # `script:` will fail
393 MESON_CROSS_ARGS: ' '
395 # If this matches, it means the pipeline is running against either the main
396 # or a stable branch, so make it manual
397 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
402 - ci/scripts/handle-subprojects-cache.py subprojects/
403 # For some reason, options are separated by newline instead of space, so we
404 # have to replace them first.
405 - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
406 - $env:MESON_CROSS_ARGS = $env:MESON_CROSS_ARGS.replace("`n"," ")
407 - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
408 meson build $env:MESON_ARGS $env:MESON_CROSS_ARGS &&
410 # XXX: Re-enable when uploading stops timing out
412 # expire_in: "7 days"
415 # - 'build/meson-logs/'
419 extends: '.build windows'
424 extends: '.build windows'
428 build vs2019 arm64 uwp:
429 extends: '.build windows'
432 # pango pulls in cairo which pulls in pixman which doesn't build because of
433 # https://github.com/mesonbuild/meson/issues/9889
435 -Dgst-plugins-base:pango=disabled
436 -Dgst-plugins-good:cairo=disabled
437 -Dgst-devtools:cairo=disabled
438 --cross-file ci/meson/vs2019-arm64-cross-file.txt
439 --native-file ci/meson/vs2019-x64-native-file.txt
442 extends: '.build windows'
450 # Make sure powershell exits on errors
451 # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
452 - $ErrorActionPreference = "Stop"
454 # Configure MSYS2 to use the UCRT64 environment, start in the same directory
456 - $env:MSYSTEM = "UCRT64"
457 - $env:CHERE_INVOKING = "1"
458 - $env:MSYS2_PATH_TYPE = "inherit"
459 # For some reason, options are separated by newline instead of space, so we
460 # have to replace them first.
461 - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
462 # Replace forward slashes with backwards so bash doesn't complain
463 - $env:_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\','/')
464 - C:\msys64\usr\bin\bash -lc "meson build $env:MESON_ARGS && ninja -C build"
471 - '.build_ccache_vars'
475 MESON_ARGS: *simple_build
477 # Disable colored output to avoid weird rendering issues
478 GST_DEBUG_NO_COLOR: "true"
479 CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/validate-logs/"
480 GST_VALIDATE_LAUNCHER_FORCE_COLORS: "true"
482 CARGO_HOME: "/cache/gstreamer/cargo"
483 # Enable the fault handler so we get backtraces on segfaults.
484 # any non-empty string will do
485 PYTHONFAULTHANDLER: "enabled"
492 - echo "-> Running ${TEST_SUITE}"
495 gst-validate-launcher ${TEST_SUITE}
502 --timeout-factor "${TIMEOUT_FACTOR}"
503 --fail-on-testlist-change
504 -l "${CI_PROJECT_DIR}/validate-logs/"
505 --xunit-file "${CI_PROJECT_DIR}/validate-logs/xunit.xml"
506 ${EXTRA_VALIDATE_ARGS}
508 - mv build/meson-logs/ meson-logs
517 - "validate-logs/*.xml"
522 - '.fdo.suffixed-image@fedora'
525 - "fedora amd64 docker"
529 extends: '.test fedora x86_64'
531 TEST_SUITE: "check.gst*"
533 integration testsuites fedora:
534 extends: '.test fedora x86_64'
537 EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX} --sync"
538 TEST_SUITE: "validate ges"
541 gstreamer-full static build:
542 extends: '.build fedora x86_64'
546 --default-library=static
552 - meson test -C build -v test-gst-full
559 gstreamer-full-minimal static build:
560 extends: 'gstreamer-full static build'
564 --default-library=static
566 -Dgstreamer:gst_debug=false
567 -Dauto_features=disabled
568 -Dgstreamer:check=enabled
570 -Dgst-plugins-base:alsa=enabled
571 -Dgst-plugins-base:typefind=enabled
572 -Dgst-plugins-base:pbtypes=enabled
573 -Dgst-full-elements=coreelements:filesrc,fakesink,identity,input-selector
574 -Dgst-full-typefind-functions=typefindfunctions:wav,flv
575 -Dgst-full-device-providers=alsa:alsadeviceprovider
576 -Dgst-full-dynamic-types=pbtypes:video_multiview_flagset
581 - meson test -C build -v test-gst-full
582 - 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"
583 - strip build/libgstreamer-full-1.0.so
584 - ls -l build/libgstreamer-full-1.0.so
592 .valgrind fedora x86_64:
593 extends: '.test fedora x86_64'
596 EXTRA_VALIDATE_ARGS: "--valgrind"
599 extends: '.valgrind fedora x86_64'
601 TEST_SUITE: "check.gstreamer\\..*"
607 - subprojects/gst-devtools/**/*
608 - subprojects/gstreamer/**/*
611 extends: '.valgrind fedora x86_64'
613 TEST_SUITE: "check.gst-plugins-base\\..*"
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 # FIXME: should rebuild the image with newer versions!
697 - pip3 install --upgrade hotdoc
698 - pip3 install --upgrade meson
700 - ./gst-env.py ninja -C build/ plugins_doc_caches
701 # Ignore modifications to wrap files made by meson
702 - git checkout subprojects/*.wrap
703 - ./ci/scripts/check-documentation-diff.py
704 - ./gst-env.py hotdoc run --conf-file=build/subprojects/gst-docs/GStreamer-doc.json --fatal-warnings
705 - mv build/subprojects/gst-docs/GStreamer-doc/html documentation/
712 - plugins-cache-diffs/
715 # This jobs runs in gstreamer namespace when after the merge into main branch.
716 # The produced artifact is later used to automatically update the web page.
724 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == "main"'
727 # This job is run in users namespace to validate documentation before merging
737 # Never run post merge, we have the `documentation` always running for that
738 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
742 - ci/gitlab/freedesktop_doc_importer.sh
744 - subprojects/gst-docs/**/*
745 - subprojects/gst-devtools/**/*
746 - subprojects/gst-editing-services/**/*
747 - subprojects/gst-libav/**/*
748 - subprojects/gst-omx/**/*
749 - subprojects/gst-plugins-bad/**/*
750 - subprojects/gst-plugins-base/**/*
751 - subprojects/gst-plugins-good/**/*
752 - subprojects/gst-plugins-ugly/**/*
753 - subprojects/gstreamer/**/*
754 - subprojects/gstreamer-vaapi/**/*
755 - subprojects/gst-rtsp-server/**/*
757 # FIXME: Using trigger: causes permission issues, workaround using old REST API.
758 # https://gitlab.com/gitlab-org/gitlab/-/issues/341737
763 - '.fdo.suffixed-image@fedora'
765 - "fedora amd64 docker"
767 - ci/gitlab/trigger_cerbero_pipeline.py
770 # Never run post merge
771 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
775 - ci/gitlab/trigger_cerbero_pipeline.py
776 - subprojects/gst-devtools/**/*
777 - subprojects/gst-editing-services/**/*
778 - subprojects/gst-libav/**/*
779 - subprojects/gst-plugins-bad/**/*
780 - subprojects/gst-plugins-base/**/*
781 - subprojects/gst-plugins-good/**/*
782 - subprojects/gst-plugins-ugly/**/*
783 - subprojects/gst-python/**/*
784 - subprojects/gstreamer/**/*
785 - subprojects/gst-rtsp-server/**/*
786 - subprojects/gst-examples/**/*