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.
115 - echo "Trigger job done, now running the pipeline."
117 # If the MR is assigned to the Merge bot, trigger the pipeline automatically
118 - if: '$CI_MERGE_REQUEST_ASSIGNEES == "gstreamer-merge-bot"'
119 # Alway run tests post merged
120 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
121 # When the assignee isn't the merge bot, require an explicit action to trigger the pipeline
122 # to avoid wasting CI resources
123 - if: '$CI_MERGE_REQUEST_ASSIGNEES != "gstreamer-merge-bot"'
129 FDO_DISTRIBUTION_VERSION: '31'
130 FDO_REPO_SUFFIX: "$FEDORA_AMD64_SUFFIX"
131 FDO_DISTRIBUTION_TAG: "$FEDORA_TAG-$GST_UPSTREAM_BRANCH"
132 FDO_DISTRIBUTION_EXEC: 'DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH bash ci/docker/fedora/prepare.sh'
137 - '.fdo.container-build@fedora'
138 stage: 'build docker'
144 FDO_DISTRIBUTION_VERSION: 'stretch'
145 FDO_REPO_SUFFIX: "$INDENT_AMD64_SUFFIX"
146 FDO_DISTRIBUTION_TAG: "$INDENT_TAG-$GST_UPSTREAM_BRANCH"
147 FDO_DISTRIBUTION_PACKAGES: 'curl indent git findutils'
149 gst-indent amd64 docker:
151 - '.gst-indent image'
152 - '.fdo.container-build@debian'
153 stage: 'build docker'
154 # Do not depend on the trigger, as we want to run indent always
157 windows amd64 docker:
158 stage: "build docker"
162 # Unlike the buildah/linux jobs, this file
163 # needs to be relative to docker/windows/ subdir
164 # as it makes life easier in the powershell script
166 # We also don't need a CONTEXT_DIR var as its also
167 # hardcoded to be docker/windows/
168 DOCKERFILE: "ci/docker/windows/Dockerfile"
174 # We need to pass an array and to resolve the env vars, so we can't use a variable:
175 - $DOCKER_BUILD_ARGS = @("--build-arg", "DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH")
177 - "& ci/docker/windows/container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $WINDOWS_IMAGE $WINDOWS_UPSTREAM_IMAGE $DOCKERFILE"
180 echo "Failed to build the image"
184 .windows rust docker build:
185 stage: 'build docker'
187 - job: 'windows amd64 docker'
190 - if: '$CI_PROJECT_NAME == "gst-ci"'
192 # Unlike the buildah/linux jobs, this file
193 # needs to be relative to docker/windows/ subdir
194 # as it makes life easier in the powershell script
196 # We also don't need a CONTEXT_DIR var as its also
197 # hardcoded to be docker/windows/
198 DOCKERFILE: 'docker/windows/rust.Dockerfile'
204 # We need to pass an array and to resolve the env vars, so we can't use a variable:
205 - $DOCKER_BUILD_ARGS = @("--build-arg", "DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH", "--build-arg", "BASE_IMAGE=$WINDOWS_IMAGE", "--build-arg", "RUST_VERSION=$RUST_VERSION")
207 - $env:WINDOWS_CONTAINER_SCRIPT_PATH = "$env:CI_PROJECT_DIR\container.ps1"
208 - echo "Fetching $env:WINDOWS_CONTAINER_SCRIPT_URL"
209 - Invoke-WebRequest -Uri $env:WINDOWS_CONTAINER_SCRIPT_URL -OutFile $env:WINDOWS_CONTAINER_SCRIPT_PATH
211 - "& $env:WINDOWS_CONTAINER_SCRIPT_PATH $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $RUST_IMAGE $RUST_UPSTREAM_IMAGE $DOCKERFILE"
214 echo "Failed to build the image"
218 windows rust amd64 docker latest stable:
219 extends: '.windows rust docker build'
221 RUST_IMAGE: !reference [variables, "WINDOWS_RUST_LATEST_IMAGE"]
222 RUST_UPSTREAM_IMAGE: !reference [variables, "WINDOWS_RUST_LATEST_UPSTREAM_IMAGE"]
223 RUST_VERSION: !reference [variables, "RUST_LATEST_VERSION"]
225 windows rust amd64 docker minimum supported version:
226 extends: '.windows rust docker build'
228 RUST_IMAGE: !reference [variables, "WINDOWS_RUST_MINIMUM_IMAGE"]
229 RUST_UPSTREAM_IMAGE: !reference [variables, "WINDOWS_RUST_MINIMUM_UPSTREAM_IMAGE"]
230 RUST_VERSION: !reference [variables, "RUST_MINIMUM_VERSION"]
234 # ---- Preparation ----- #
240 - '.gst-indent image'
241 - '.fdo.suffixed-image@debian'
244 - job: 'gst-indent amd64 docker'
247 # man indent. grep RETURN VALUE, grab a beer on my behalf...
248 - indent --version || true
249 - ./scripts/gst-indent-all
251 if git diff --quiet -- ':!subprojects/gst-integration-testsuites/medias' .; then
252 echo "Code is properly formatted"
254 git diff --color=always -- ':!subprojects/gst-integration-testsuites/medias' .
255 echo 'style diverges, please run gst-indent first'
260 # build setup templates
262 .build_template: &build
265 - meson build/ $MESON_ARGS
267 - ccache --show-stats
271 CCACHE_COMPILERCHECK: 'content'
272 CCACHE_COMPRESS: 'true'
273 CCACHE_BASEDIR: '/cache/gstreamer/gstreamer'
274 CCACHE_DIR: '/cache/gstreamer/gstreamer/ccache/'
275 # shared across everything really
276 CCACHE_MAXSIZE: '10G'
277 CARGO_HOME: '/cache/gstreamer/cargo'
279 .base_modules_changes: &modules_changes
283 - subprojects/gst-devtools/**/*
284 - subprojects/gst-editing-services/**/*
285 - subprojects/gst-integration-testsuites/**/*
286 - subprojects/gst-libav/**/*
287 - subprojects/gst-omx/**/*
288 - subprojects/gst-plugins-bad/**/*
289 - subprojects/gst-plugins-base/**/*
290 - subprojects/gst-plugins-good/**/*
291 - subprojects/gst-plugins-ugly/**/*
292 - subprojects/gst-python/**/*
293 - subprojects/gstreamer/**/*
294 - subprojects/gstreamer-sharp/**/*
295 - subprojects/gstreamer-vaapi/**/*
296 - subprojects/gst-rtsp-server/**/*
298 .simple_fedora_build: &simple_build >-
299 ${DEFAULT_MESON_ARGS}
302 -Dgst-omx:target=generic
305 ${MESON_BUILDTYPE_ARGS}
311 - '.build_ccache_vars'
314 # Taking into account the slowest shared runner + time needed to upload the binaries to artifacts
315 # Also need to take into account I/O of pulling docker images and uploading artifacts
318 MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
320 - export RUSTUP_HOME="/usr/local/rustup"
321 - export CARGO_HOME="/usr/local/cargo"
322 - export PATH="/usr/local/cargo/bin:$PATH"
324 - ci/scripts/handle-subprojects-cache.py subprojects/
325 # Update subprojects to respect `.wrap` content
326 - meson subprojects update --reset
330 - mv build/meson-logs/ meson-logs
337 # If this matches, it means the pipeline is running against either the main
338 # or a stable branch, so make it manual
339 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
344 .build fedora x86_64:
347 - '.fdo.suffixed-image@fedora'
350 - "fedora amd64 docker"
352 MESON_ARGS: *simple_build
354 build nodebug fedora x86_64:
357 - '.fdo.suffixed-image@fedora'
360 - "fedora amd64 docker"
362 MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
364 build clang fedora x86_64:
365 extends: '.build fedora x86_64'
368 CXX: 'ccache clang++'
371 image: $WINDOWS_IMAGE
378 - "windows amd64 docker"
382 ${DEFAULT_MESON_ARGS}
386 -Dgst-plugins-base:pango=enabled
387 -Dgst-plugins-good:cairo=enabled
389 # If this matches, it means the pipeline is running against either the main
390 # or a stable branch, so make it manual
391 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
396 - ci/scripts/handle-subprojects-cache.py subprojects/
398 # For some reason, options are separated by newline instead of space, so we
399 # have to replace them first.
400 - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
401 - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
402 meson build $env:MESON_ARGS &&
404 # XXX: Re-enable when uploading stops timing out
406 # expire_in: "7 days"
409 # - 'build/meson-logs/'
412 extends: '.build windows'
417 extends: '.build windows'
422 extends: '.build windows'
430 # Make sure powershell exits on errors
431 # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
432 - $ErrorActionPreference = "Stop"
434 # Configure MSYS2 to use the UCRT64 environment, start in the same directory
436 - $env:MSYSTEM = "UCRT64"
437 - $env:CHERE_INVOKING = "1"
438 - $env:MSYS2_PATH_TYPE = "inherit"
439 # For some reason, options are separated by newline instead of space, so we
440 # have to replace them first.
441 - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
442 # Replace forward slashes with backwards so bash doesn't complain
443 - $env:_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\','/')
444 - C:\msys64\usr\bin\bash -lc "meson build $env:MESON_ARGS && ninja -C build"
451 - '.build_ccache_vars'
455 MESON_ARGS: *simple_build
457 # Disable colored output to avoid weird rendering issues
458 GST_DEBUG_NO_COLOR: "true"
459 CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/validate-logs/"
460 GST_VALIDATE_LAUNCHER_FORCE_COLORS: "true"
462 CARGO_HOME: "/cache/gstreamer/cargo"
463 # Enable the fault handler so we get backtraces on segfaults.
464 # any non-empty string will do
465 PYTHONFAULTHANDLER: "enabled"
472 - echo "-> Running ${TEST_SUITE}"
475 gst-validate-launcher ${TEST_SUITE}
482 --timeout-factor "${TIMEOUT_FACTOR}"
483 --fail-on-testlist-change
484 -l "${CI_PROJECT_DIR}/validate-logs/"
485 --xunit-file "${CI_PROJECT_DIR}/validate-logs/xunit.xml"
486 ${EXTRA_VALIDATE_ARGS}
488 - mv build/meson-logs/ meson-logs
497 - "validate-logs/*.xml"
502 - '.fdo.suffixed-image@fedora'
505 - "fedora amd64 docker"
509 extends: '.test fedora x86_64'
511 TEST_SUITE: "check.gst*"
513 integration testsuites fedora:
514 extends: '.test fedora x86_64'
517 EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX} --sync"
518 TEST_SUITE: "validate ges"
521 gstreamer-full static build:
522 extends: '.build fedora x86_64'
526 --default-library=static
532 - meson test -C build -v test-gst-full
539 gstreamer-full-minimal static build:
540 extends: 'gstreamer-full static build'
544 --default-library=static
546 -Dgstreamer:gst_debug=false
547 -Dauto_features=disabled
548 -Dgstreamer:check=enabled
550 -Dgst-plugins-base:alsa=enabled
551 -Dgst-plugins-base:typefind=enabled
552 -Dgst-plugins-base:pbtypes=enabled
553 -Dgst-full-elements=coreelements:filesrc,fakesink,identity,input-selector
554 -Dgst-full-typefind-functions=typefindfunctions:wav,flv
555 -Dgst-full-device-providers=alsa:alsadeviceprovider
556 -Dgst-full-dynamic-types=pbtypes:video_multiview_flagset
561 - meson test -C build -v test-gst-full
562 - 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"
563 - strip build/libgstreamer-full-1.0.so
564 - ls -l build/libgstreamer-full-1.0.so
572 .valgrind fedora x86_64:
573 extends: '.test fedora x86_64'
576 EXTRA_VALIDATE_ARGS: "--valgrind"
579 extends: '.valgrind fedora x86_64'
581 TEST_SUITE: "check.gstreamer\\..*"
587 - subprojects/gst-devtools/**/*
588 - subprojects/gstreamer/**/*
591 extends: '.valgrind fedora x86_64'
593 TEST_SUITE: "check.gst-plugins-base\\..*"
599 - subprojects/gst-devtools/**/*
600 - subprojects/gstreamer/**/*
601 - subprojects/gst-plugins-base/**/*
604 extends: '.valgrind fedora x86_64'
606 TEST_SUITE: "check.gst-plugins-good\\..*"
607 # take longer time due to splitmux unit test
614 - subprojects/gst-devtools/**/*
615 - subprojects/gstreamer/**/*
616 - subprojects/gst-plugins-base/**/*
617 - subprojects/gst-plugins-good/**/*
620 extends: '.valgrind fedora x86_64'
622 TEST_SUITE: "check.gst-plugins-ugly\\..*"
628 - subprojects/gst-devtools/**/*
629 - subprojects/gstreamer/**/*
630 - subprojects/gst-plugins-base/**/*
631 - subprojects/gst-plugins-good/**/*
632 - subprojects/gst-plugins-ugly/**/*
635 extends: '.valgrind fedora x86_64'
637 TEST_SUITE: "check.gst-plugins-bad\\..*"
643 - subprojects/gst-devtools/**/*
644 - subprojects/gstreamer/**/*
645 - subprojects/gst-plugins-base/**/*
646 - subprojects/gst-plugins-good/**/*
647 - subprojects/gst-plugins-bad/**/*
650 extends: '.valgrind fedora x86_64'
652 TEST_SUITE: "check.gst-editing-services\\..*"
658 - subprojects/gst-devtools/**/*
659 - subprojects/gstreamer/**/*
660 - subprojects/gst-plugins-base/**/*
661 - subprojects/gst-plugins-good/**/*
662 - subprojects/gst-plugins-bad/**/*
663 - subprojects/gst-editing-services/**/*
665 # ---- Integration ----- #
668 image: $FEDORA_DOCS_IMAGE
670 - '.build_ccache_vars'
672 MESON_ARGS: *simple_build
673 MESON_BUILDTYPE_ARGS: "-Ddoc=enabled"
674 CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
676 # FIXME: should rebuild the image with newer versions!
677 - pip3 install --upgrade hotdoc
678 - pip3 install --upgrade meson
680 - ./gst-env.py ninja -C build/ plugins_doc_caches
681 - ./ci/scripts/check-documentation-diff.py
682 - ./gst-env.py hotdoc run --conf-file=build/subprojects/gst-docs/GStreamer-doc.json --fatal-warnings
683 - mv build/subprojects/gst-docs/GStreamer-doc/html documentation/
690 - plugins-cache-diffs/
693 # This jobs runs in gstreamer namespace when after the merge into main branch.
694 # The produced artifact is later used to automatically update the web page.
702 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == "main"'
705 # This job is run in users namespace to validate documentation before merging
715 # Never run post merge, we have the `documentation` always running for that
716 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
720 - ci/gitlab/freedesktop_doc_importer.sh
722 - subprojects/gst-docs/**/*
723 - subprojects/gst-devtools/**/*
724 - subprojects/gst-editing-services/**/*
725 - subprojects/gst-libav/**/*
726 - subprojects/gst-omx/**/*
727 - subprojects/gst-plugins-bad/**/*
728 - subprojects/gst-plugins-base/**/*
729 - subprojects/gst-plugins-good/**/*
730 - subprojects/gst-plugins-ugly/**/*
731 - subprojects/gstreamer/**/*
732 - subprojects/gstreamer-vaapi/**/*
733 - subprojects/gst-rtsp-server/**/*
735 # FIXME: Using trigger: causes permission issues, workaround using old REST API.
736 # https://gitlab.com/gitlab-org/gitlab/-/issues/341737
741 - '.fdo.suffixed-image@fedora'
743 - "fedora amd64 docker"
745 - ci/gitlab/trigger_cerbero_pipeline.py
748 # Never run post merge
749 - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
753 - ci/gitlab/trigger_cerbero_pipeline.py
754 - subprojects/gst-devtools/**/*
755 - subprojects/gst-editing-services/**/*
756 - subprojects/gst-libav/**/*
757 - subprojects/gst-plugins-bad/**/*
758 - subprojects/gst-plugins-base/**/*
759 - subprojects/gst-plugins-good/**/*
760 - subprojects/gst-plugins-ugly/**/*
761 - subprojects/gst-python/**/*
762 - subprojects/gstreamer/**/*
763 - subprojects/gst-rtsp-server/**/*
764 - subprojects/gst-examples/**/*