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 clang fedora x86_64:
363 extends: '.build fedora x86_64'
366 CXX: 'ccache clang++'
369 image: $WINDOWS_IMAGE
376 - "windows amd64 docker"
380 ${DEFAULT_MESON_ARGS}
384 -Dgst-plugins-base:pango=enabled
385 -Dgst-plugins-good:cairo=enabled
387 # If this matches, it means the pipeline is running against either the main
388 # or a stable branch, so make it manual
389 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
394 - ci/scripts/handle-subprojects-cache.py subprojects/
396 # For some reason, options are separated by newline instead of space, so we
397 # have to replace them first.
398 - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
399 - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
400 meson build $env:MESON_ARGS &&
402 # XXX: Re-enable when uploading stops timing out
404 # expire_in: "7 days"
407 # - 'build/meson-logs/'
410 extends: '.build windows'
415 extends: '.build windows'
420 extends: '.build windows'
428 # Make sure powershell exists on errors
429 # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
430 - $ErrorActionPreference = "Stop"
432 # Configure MSYS2 to use the UCRT64 environment, start in the same directory
434 - $env:MSYSTEM = "UCRT64"
435 - $env:CHERE_INVOKING = "1"
436 - $env:MSYS2_PATH_TYPE = "inherit"
437 # For some reason, options are separated by newline instead of space, so we
438 # have to replace them first.
439 - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
440 # Replace forward slashes with backwards so bash doesn't complain
441 - $env:_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\','/')
442 - C:\msys64\usr\bin\bash -lc "meson build $env:MESON_ARGS && ninja -C build"
449 - '.build_ccache_vars'
453 MESON_ARGS: *simple_build
455 # Disable colored output to avoid weird rendering issues
456 GST_DEBUG_NO_COLOR: "true"
457 CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/validate-logs/"
458 GST_VALIDATE_LAUNCHER_FORCE_COLORS: "true"
460 CARGO_HOME: "/cache/gstreamer/cargo"
461 # Enable the fault handler so we get backtraces on segfaults.
462 # any non-empty string will do
463 PYTHONFAULTHANDLER: "enabled"
470 - echo "-> Running ${TEST_SUITE}"
473 gst-validate-launcher ${TEST_SUITE}
480 --timeout-factor "${TIMEOUT_FACTOR}"
481 --fail-on-testlist-change
482 -l "${CI_PROJECT_DIR}/validate-logs/"
483 --xunit-file "${CI_PROJECT_DIR}/validate-logs/xunit.xml"
484 ${EXTRA_VALIDATE_ARGS}
486 - mv build/meson-logs/ meson-logs
495 - "validate-logs/*.xml"
500 - '.fdo.suffixed-image@fedora'
503 - "fedora amd64 docker"
507 extends: '.test fedora x86_64'
509 TEST_SUITE: "check.gst*"
511 integration testsuites fedora:
512 extends: '.test fedora x86_64'
515 EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX} --sync"
516 TEST_SUITE: "validate ges"
519 gstreamer-full static build:
520 extends: '.build fedora x86_64'
524 --default-library=static
530 - meson test -C build -v test-gst-full
537 gstreamer-full-minimal static build:
538 extends: 'gstreamer-full static build'
542 --default-library=static
544 -Dgstreamer:gst_debug=false
545 -Dauto_features=disabled
546 -Dgstreamer:check=enabled
548 -Dgst-plugins-base:alsa=enabled
549 -Dgst-plugins-base:typefind=enabled
550 -Dgst-plugins-base:pbtypes=enabled
551 -Dgst-full-elements=coreelements:filesrc,fakesink,identity,input-selector
552 -Dgst-full-typefind-functions=typefindfunctions:wav,flv
553 -Dgst-full-device-providers=alsa:alsadeviceprovider
554 -Dgst-full-dynamic-types=pbtypes:video_multiview_flagset
559 - meson test -C build -v test-gst-full
560 - 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"
561 - strip build/libgstreamer-full-1.0.so
562 - ls -l build/libgstreamer-full-1.0.so
570 .valgrind fedora x86_64:
571 extends: '.test fedora x86_64'
574 EXTRA_VALIDATE_ARGS: "--valgrind"
577 extends: '.valgrind fedora x86_64'
579 TEST_SUITE: "check.gstreamer\\..*"
585 - subprojects/gst-devtools/**/*
586 - subprojects/gstreamer/**/*
589 extends: '.valgrind fedora x86_64'
591 TEST_SUITE: "check.gst-plugins-base\\..*"
597 - subprojects/gst-devtools/**/*
598 - subprojects/gstreamer/**/*
599 - subprojects/gst-plugins-base/**/*
602 extends: '.valgrind fedora x86_64'
604 TEST_SUITE: "check.gst-plugins-good\\..*"
605 # take longer time due to splitmux unit test
612 - subprojects/gst-devtools/**/*
613 - subprojects/gstreamer/**/*
614 - subprojects/gst-plugins-base/**/*
615 - subprojects/gst-plugins-good/**/*
618 extends: '.valgrind fedora x86_64'
620 TEST_SUITE: "check.gst-plugins-ugly\\..*"
626 - subprojects/gst-devtools/**/*
627 - subprojects/gstreamer/**/*
628 - subprojects/gst-plugins-base/**/*
629 - subprojects/gst-plugins-good/**/*
630 - subprojects/gst-plugins-ugly/**/*
633 extends: '.valgrind fedora x86_64'
635 TEST_SUITE: "check.gst-plugins-bad\\..*"
641 - subprojects/gst-devtools/**/*
642 - subprojects/gstreamer/**/*
643 - subprojects/gst-plugins-base/**/*
644 - subprojects/gst-plugins-good/**/*
645 - subprojects/gst-plugins-bad/**/*
648 extends: '.valgrind fedora x86_64'
650 TEST_SUITE: "check.gst-editing-services\\..*"
656 - subprojects/gst-devtools/**/*
657 - subprojects/gstreamer/**/*
658 - subprojects/gst-plugins-base/**/*
659 - subprojects/gst-plugins-good/**/*
660 - subprojects/gst-plugins-bad/**/*
661 - subprojects/gst-editing-services/**/*
663 # ---- Integration ----- #
666 image: $FEDORA_DOCS_IMAGE
668 - '.build_ccache_vars'
670 MESON_ARGS: *simple_build
671 MESON_BUILDTYPE_ARGS: "-Ddoc=enabled"
672 CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
674 # FIXME: should rebuild the image with newer versions!
675 - pip3 install --upgrade hotdoc
676 - pip3 install --upgrade meson
678 - ./gst-env.py ninja -C build/ plugins_doc_caches
679 - ./ci/scripts/check-documentation-diff.py
680 - ./gst-env.py hotdoc run --conf-file=build/subprojects/gst-docs/GStreamer-doc.json --fatal-warnings
681 - mv build/subprojects/gst-docs/GStreamer-doc/html documentation/
688 - plugins-cache-diffs/
691 # This jobs runs in gstreamer namespace when after the merge into main branch.
692 # The produced artifact is later used to automatically update the web page.
700 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == "main"'
703 # This job is run in users namespace to validate documentation before merging
713 # Never run post merge, we have the `documentation` always running for that
714 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
718 - ci/gitlab/freedesktop_doc_importer.sh
720 - subprojects/gst-docs/**/*
721 - subprojects/gst-devtools/**/*
722 - subprojects/gst-editing-services/**/*
723 - subprojects/gst-libav/**/*
724 - subprojects/gst-omx/**/*
725 - subprojects/gst-plugins-bad/**/*
726 - subprojects/gst-plugins-base/**/*
727 - subprojects/gst-plugins-good/**/*
728 - subprojects/gst-plugins-ugly/**/*
729 - subprojects/gstreamer/**/*
730 - subprojects/gstreamer-vaapi/**/*
731 - subprojects/gst-rtsp-server/**/*
733 # FIXME: Using trigger: causes permission issues, workaround using old REST API.
734 # https://gitlab.com/gitlab-org/gitlab/-/issues/341737
739 - '.fdo.suffixed-image@fedora'
741 - "fedora amd64 docker"
743 - ci/gitlab/trigger_cerbero_pipeline.py
746 # Never run post merge
747 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
751 - ci/gitlab/trigger_cerbero_pipeline.py
752 - subprojects/gst-devtools/**/*
753 - subprojects/gst-editing-services/**/*
754 - subprojects/gst-libav/**/*
755 - subprojects/gst-plugins-bad/**/*
756 - subprojects/gst-plugins-base/**/*
757 - subprojects/gst-plugins-good/**/*
758 - subprojects/gst-plugins-ugly/**/*
759 - subprojects/gst-python/**/*
760 - subprojects/gstreamer/**/*
761 - subprojects/gst-rtsp-server/**/*
762 - subprojects/gst-examples/**/*