2 - template: 'Workflows/Branch-Pipelines.gitlab-ci.yml'
10 # Use the resulting binaries
14 # Branch to track for modules that have no ref specified in the manifest
15 GST_UPSTREAM_BRANCH: 'master'
16 ORC_UPSTREAM_BRANCH: 'master'
20 # These are the version tags for the docker images the CI runs against.
21 # If you are hacking on them or need a them to rebuild, its enough
22 # to change any part of the string of the image you want.
24 FEDORA_TAG: '2020-09-15.0'
25 CERBERO_TAG: '2020-09-09.2'
26 ANDROID_TAG: '2020-09-09.2'
27 MANIFEST_TAG: '2020-06-25.0'
28 TEST_MANIFEST_TAG: '2020-06-25.0'
29 INDENT_TAG: '2020-06-29.0'
31 GST_UPSTREAM_REPO: 'gstreamer/gst-ci'
33 FEDORA_AMD64_SUFFIX: 'amd64/fedora'
34 CERBERO_AMD64_SUFFIX: 'amd64/cerbero-fedora'
35 ANDROID_AMD64_SUFFIX: 'amd64/android-fedora'
36 MANIFEST_AMD64_SUFFIX: 'amd64/build-manifest'
37 TEST_MANIFEST_AMD64_SUFFIX: 'amd64/test-manifest'
38 INDENT_AMD64_SUFFIX: 'amd64/gst-indent'
40 FEDORA_IMAGE: "$CI_REGISTRY_IMAGE/$FEDORA_AMD64_SUFFIX:$FEDORA_TAG-$GST_UPSTREAM_BRANCH"
41 FEDORA_DOCS_IMAGE: "registry.freedesktop.org/gstreamer/gst-ci/amd64/fedora:2020-07-03.0-master"
42 CERBERO_IMAGE: "$CI_REGISTRY_IMAGE/$CERBERO_AMD64_SUFFIX:$CERBERO_TAG-$GST_UPSTREAM_BRANCH"
43 ANDROID_IMAGE: "$CI_REGISTRY_IMAGE/$ANDROID_AMD64_SUFFIX:$ANDROID_TAG-$GST_UPSTREAM_BRANCH"
44 MANIFEST_IMAGE: "$CI_REGISTRY_IMAGE/$MANIFEST_AMD64_SUFFIX:$MANIFEST_TAG-$GST_UPSTREAM_BRANCH"
45 TEST_MANIFEST_IMAGE: "$CI_REGISTRY_IMAGE/$TEST_MANIFEST_AMD64_SUFFIX:$TEST_MANIFEST_TAG-$GST_UPSTREAM_BRANCH"
46 INDENT_IMAGE: "$CI_REGISTRY_IMAGE/$INDENT_AMD64_SUFFIX:$INDENT_TAG-$GST_UPSTREAM_BRANCH"
48 WINDOWS_IMAGE: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/windows:v12-master'
50 # Can't use $CI_* variables since we use this template in all repos, not just gst-ci
51 CERBERO_SCRIPT_URL: "https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/cerbero_setup.sh"
54 MESON_BUILDTYPE_ARGS: --default-library=both
56 -Dlibnice:tests=disabled
57 -Dlibnice:examples=disabled
58 -Dopenh264:tests=disabled
59 -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
87 DEFAULT_CERBERO_ARGS: >
94 # This can be used to configure global behaviour our our jobs.
100 - 'runner_system_failure'
101 - 'stuck_or_timeout_failure'
102 - 'scheduler_failure'
107 # Script to check if a docker image exists in the upstream registry
108 # and if so copy it to the forked registry so we can use it
110 # This is copied/adapted from citemplates/templates/fedora.yml
111 # https://gitlab.freedesktop.org/freedesktop/ci-templates/-/blob/96b621fe9f57ec2464f8d1a0940446afbf6c8f59/templates/fedora.yml
112 .check_image: &check_image_exists |
113 # if-not-exists steps
116 if [[ -z "$GST_FORCE_REBUILD" ]]
118 # disable exit on failure
121 # check if our image is already in the current registry
122 # we store the sha of the digest and the layers
123 skopeo inspect docker://$LOCAL_IMAGE | jq '[.Digest, .Layers]' > local_sha
125 # check if our image is already in our gst-ci registry fork
126 skopeo inspect docker://$LOCAL_GST_CI_IMAGE | jq '[.Digest, .Layers]' > local_gst_ci_sha
128 # check if our image is already in the upstream registry
129 if [[ -z "$GST_UPSTREAM_REPO" ]]
131 echo "WARNING! Variable \$GST_UPSTREAM_REPO is undefined, cannot check for images"
133 skopeo inspect docker://$GST_UPSTREAM_IMAGE | jq '[.Digest, .Layers]' > upstream_sha
136 # reenable exit on failure
139 # if the upstream repo has an image, ensure we use the same
140 if [ -s upstream_sha ]
143 echo "Checking if $LOCAL_IMAGE is up to date"
144 # ensure we use the same image from upstream
145 diff upstream_sha local_sha && exit 0 || true
147 echo "Copying image from gstreamer/gst-ci to local registry"
148 # copy the original image into the current project registry namespace
149 # we do 2 attempts with skopeo copy at most
150 skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
151 docker://$GST_UPSTREAM_IMAGE \
152 docker://$LOCAL_IMAGE || \
153 skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
154 docker://$GST_UPSTREAM_IMAGE \
155 docker://$LOCAL_IMAGE
162 # if the local ci fork repo has an image, ensure we use the same
163 if [ -s local_gst_ci_sha ]
165 echo "Checking if $LOCAL_GST_CI_IMAGE is up to date"
166 # ensure we use the same image from upstream
167 diff local_gst_ci_sha local_sha && exit 0 || true
169 echo "Copying image from $CI_PROJECT_NAMESPACE/gst-ci to local registry"
170 # copy the original image into the current project registry namespace
171 # we do 2 attempts with skopeo copy at most
172 skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
173 docker://$LOCAL_GST_CI_IMAGE \
174 docker://$LOCAL_IMAGE || \
175 skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
176 docker://$LOCAL_GST_CI_IMAGE \
177 docker://$LOCAL_IMAGE
182 # if we have a local image but none in the upstream repo, use our
185 echo "Using $LOCAL_IMAGE"
191 # Build docker images from Dockerfiles
193 # This is copied/adapted from citemplates/templates/fedora.yml
194 # https://gitlab.freedesktop.org/freedesktop/ci-templates/-/blob/96b621fe9f57ec2464f8d1a0940446afbf6c8f59/templates/fedora.yml
196 # CITemplates builds uses buildah run/commit workflow to build the images which doesn't
197 # fit us atm and our images need further adjustment to make use of it. Porting to
198 # ci-templates is the next step though.
200 # All the documentation from citemplates should be applicable here, so please refer there
202 image: "$CI_REGISTRY/freedesktop/ci-templates/buildah:2020-07-20.1"
204 STORAGE_DRIVER: 'vfs'
205 BUILDAH_FORMAT: 'docker'
206 BUILDAH_ISOLATION: 'chroot'
210 - export LOCAL_IMAGE="$CI_REGISTRY_IMAGE/$REPO_SUFFIX:$TAG"
211 - export LOCAL_GST_CI_IMAGE="$CI_REGISTRY/$CI_PROJECT_NAMESPACE/gst-ci/$REPO_SUFFIX:$TAG"
212 - export GST_UPSTREAM_IMAGE="$CI_REGISTRY/$GST_UPSTREAM_REPO/$REPO_SUFFIX:$TAG"
214 # check if the docker registry is enabled, else the variable will be missing
216 if [[ -z "$CI_REGISTRY_IMAGE" ]]
218 echo "ERROR! Looks like your repository/fork has disabled Docker Registries."
219 echo "Pleae enable them by following the documentation from here:"
220 echo "https://docs.gitlab.com/ee/user/packages/container_registry/#enable-the-container-registry-for-your-project"
224 # Newer versions of podman/buildah try to set overlayfs mount options when
225 # using the vfs driver, and this causes errors.
226 - sed -i '/^mountopt =.*/d' /etc/containers/storage.conf
228 - *check_image_exists
230 # This part of the job should only ever be possible to be reach in a gst-ci fork
232 if [[ "$CI_PROJECT_NAME" != 'gst-ci' ]]
234 echo "ERROR! Something is wrong!"
235 echo "This part of the job is supposed to be executed only in gst-ci forks, and its probably going to fail else"
239 - echo "Building image $LOCAL_IMAGE"
243 --build-arg DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH
244 --label ci.job_id=$CI_JOB_ID
245 --label pipeline.url=$CI_PIPELINE_URL
246 --label git.ref_name=$CI_COMMIT_REF_NAME
247 --label git.sha=$CI_COMMIT_SHA
248 --label gitlab.project_path=$CI_PROJECT_PATH
249 --label gitlab.project_url=$CI_PROJECT_URL
250 --label fdo.upstream-repo=$GST_UPSTREAM_REPO
251 --label fdo.expires-after="3w"
256 - buildah login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
260 if [ "$CI_PROJECT_PATH" = "gstreamer/gst-ci" ]; then
261 if [ "$LOCAL_IMAGE" != "$GST_UPSTREAM_IMAGE" ]; then
262 echo "ERROR!!! AAAAA! THE IMAGE URI DOES NOT MATCH THE EXPECTED UPSTREAM ONE"
264 echo $GST_UPSTREAM_IMAGE
269 - buildah push $LOCAL_IMAGE
272 stage: "build docker"
274 REPO_SUFFIX: "$FEDORA_AMD64_SUFFIX"
275 TAG: "$FEDORA_TAG-$GST_UPSTREAM_BRANCH"
277 CONTEXT_DIR: "./docker/fedora/"
278 DOCKERFILE: "docker/fedora/Dockerfile"
281 cerbero fedora amd64 docker:
282 stage: "build docker"
284 REPO_SUFFIX: "$CERBERO_AMD64_SUFFIX"
285 TAG: "$CERBERO_TAG-$GST_UPSTREAM_BRANCH"
287 CONTEXT_DIR: "docker/cerbero/"
288 DOCKERFILE: "docker/cerbero/Dockerfile-fedora"
292 stage: "build docker"
294 REPO_SUFFIX: "$ANDROID_AMD64_SUFFIX"
295 TAG: "$ANDROID_TAG-$GST_UPSTREAM_BRANCH"
297 CONTEXT_DIR: "docker/android/"
298 DOCKERFILE: "docker/android/Dockerfile"
301 alpine amd64 manifest builder docker:
302 stage: "build docker"
304 REPO_SUFFIX: "$MANIFEST_AMD64_SUFFIX"
305 TAG: '$MANIFEST_TAG-$GST_UPSTREAM_BRANCH'
307 CONTEXT_DIR: "docker/build_manifest/"
308 DOCKERFILE: "docker/build_manifest/Dockerfile"
311 gst-indent amd64 docker:
312 stage: "build docker"
314 REPO_SUFFIX: "$INDENT_AMD64_SUFFIX"
315 TAG: "$INDENT_TAG-$GST_UPSTREAM_BRANCH"
317 CONTEXT_DIR: "docker/indent/"
318 DOCKERFILE: "docker/indent/Dockerfile"
322 # Job to create the manifest.xml to used for our builds
325 image: $MANIFEST_IMAGE
327 # Always have automatic pipeline for branchs in cerbero and docs
328 # cause they need to update artifacts, like the docs site or cerbero deps
329 - if: '$CI_PROJECT_PATH == "gstreamer/cerbero"'
330 - if: '$CI_PROJECT_PATH == "gstreamer/gst-docs"'
332 # If the user that triggered the Pipeline is the Merge bot and the branch doesn't match
333 # the upstream branch set, run the pipeline
334 - if: '$GITLAB_USER_LOGIN == "gstreamer-merge-bot" && $CI_COMMIT_BRANCH != $GST_UPSTREAM_BRANCH'
335 # When the user isn't the merge bot, require an explicit action to trigger the pipeline
336 # to avoid wasting CI resources
337 - if: '$GITLAB_USER_LOGIN != "gstreamer-merge-bot"'
339 # If this matches, it means the pipeline is running against either the main
340 # or a stable branch, so make it manual
341 - if: '$CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
347 - gitlab/build_manifest.py --self-update
348 - gitlab/build_manifest.py ${CI_PROJECT_DIR}/manifest.xml
349 - cat ${CI_PROJECT_DIR}/manifest.xml
362 GIT_STRATEGY: 'fetch'
364 - if: '$CI_PROJECT_NAME !~ /^(gstreamer-sharp|gst-integration-testsuites|cerbero|gst-docs)$/'
366 # man indent. grep RETURN VALUE, grab a beer on my behalf...
367 - indent --version || true
370 if test -f ".indentignore"; then
372 while read -r line; do
373 if test -n "$line"; then
374 filter_args+=("-e" "$line")
376 done < ".indentignore"
377 if [[ ${#filter_args[@]} -gt 0 ]]; then
378 filter_cmd=("grep" "-v" "${filter_args[@]}")
381 find . -name '*.c' | "${filter_cmd[@]}" | xargs -d '\n' gst-indent
383 if git diff --quiet; then
384 echo "Code is properly formatted"
386 git diff --color=always
387 echo 'style diverges, please run gst-indent first'
392 # gst-build setup templates
394 .gst_build_template: &gst_build
396 # Sometimes, gitlab-runner want to reuse
397 # existing docker volumes without cleaning them up...
398 # Make sure the docker volume is clean
399 - rm -rf gst-build || true
400 - rm -rf meson-logs || true
401 - rm -rf validate-logs || true
403 - curl -L -o clone_manifest_ref.py "https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/clone_manifest_ref.py"
404 - python3 clone_manifest_ref.py --manifest manifest.xml --project gst-build --destination gst-build
406 # only copy immediate directories. We don't want to modify .wrap files
407 - find /gst-build/subprojects/ -mindepth 1 -maxdepth 1 -type d -exec cp -r \{\} subprojects/ \;
408 - ./git-update --no-interaction --manifest="${CI_PROJECT_DIR}/manifest.xml"
409 - meson build/ $MESON_ARGS
411 - ccache --show-stats
413 .gst_build_ccache_vars:
415 CCACHE_COMPILERCHECK: 'content'
416 CCACHE_COMPRESS: 'true'
417 CCACHE_BASEDIR: '/cache/gstreamer/gst-build'
418 CCACHE_DIR: '/cache/gstreamer/gst-build/ccache/'
419 # shared across everything really
420 CCACHE_MAXSIZE: '10G'
421 CARGO_HOME: '/cache/gstreamer/cargo'
423 .simple_fedora_build: &simple_build >-
424 ${DEFAULT_MESON_ARGS}
427 -Dgst-omx:target=generic
430 ${MESON_BUILDTYPE_ARGS}
436 - '.gst_build_ccache_vars'
439 # Taking into account the slowest shared runner + time needed to upload the binaries to artifacts
440 # Also need to take into account I/O of pulling docker images and uploading artifacts
443 MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
445 - if: '$CI_PROJECT_NAME != "cerbero"'
449 - mv gst-build/build/meson-logs/ meson-logs
450 # Cleanup everything else to reduce the size
451 # of the docker volume we leave behind
460 .build fedora x86_64:
464 MESON_ARGS: *simple_build
466 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-omx|gst-plugins-rs)$/'
468 build nodebug fedora x86_64:
472 MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
474 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
476 build static fedora x86_64:
477 extends: '.build fedora x86_64'
479 MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
481 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
483 build static nodebug fedora x86_64:
484 extends: 'build nodebug fedora x86_64'
486 MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
488 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
490 build clang fedora x86_64:
491 extends: '.build fedora x86_64'
494 CXX: 'ccache clang++'
496 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
501 - '.gst_build_ccache_vars'
505 MESON_ARGS: *simple_build
507 # Disable colored output to avoid weird rendering issues
508 GST_DEBUG_NO_COLOR: "true"
509 CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/validate-logs/"
510 GST_VALIDATE_LAUNCHER_FORCE_COLORS: "true"
512 CARGO_HOME: "/cache/gstreamer/cargo"
513 # Enable the fault handler so we get backtraces on segfaults.
514 # any non-empty string will do
515 PYTHONFAULTHANDLER: "enabled"
517 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-examples|gst-docs)$/'
521 - echo "-> Running ${TEST_SUITE}"
524 gst-validate-launcher ${TEST_SUITE}
530 --timeout-factor "${TIMEOUT_FACTOR}"
531 --fail-on-testlist-change
532 -l "${CI_PROJECT_DIR}/validate-logs/"
533 --xunit-file "${CI_PROJECT_DIR}/validate-logs/xunit.xml"
534 ${EXTRA_VALIDATE_ARGS}
536 - mv gst-build/build/meson-logs/ meson-logs
537 # Cleanup everything else to reduce the size
538 # of the docker volume we leave behind
549 - "validate-logs/*.xml"
557 extends: '.test fedora x86_64'
559 TEST_SUITE: "check.gst*"
561 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
563 integration testsuites fedora:
564 extends: '.test fedora x86_64'
567 EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --check-bugs --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX}"
568 TEST_SUITE: "validate ges"
570 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-examples|gst-omx|gstreamer-sharp|gst-plugins-rs)$/'
573 extends: 'build static fedora x86_64'
577 --default-library=static
578 -Dauto_features=disabled
579 -Dgst-plugins-good:alpha=enabled
582 - if: '$CI_PROJECT_NAME =~ /^(gst-build|gst-ci)$/'
586 - ninja -C build install
587 - export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib64/gstreamer-1.0/pkgconfig
588 - export LD_LIBRARY_PATH=/usr/local/lib64
589 - cd examples/static-plugins
592 - meson test -C _build -v
597 - 'gst-build/build/meson-logs/'
598 - 'gst-build/build/gstinitstaticplugins.c'
601 .valgrind fedora x86_64:
602 extends: '.test fedora x86_64'
605 EXTRA_VALIDATE_ARGS: "--valgrind"
608 extends: '.valgrind fedora x86_64'
610 TEST_SUITE: "check.gstreamer\\..*"
612 - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-ci|gst-devtools)$/'
615 extends: '.valgrind fedora x86_64'
617 TEST_SUITE: "check.gst-plugins-base\\..*"
619 - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-ci|gst-devtools)$/'
622 extends: '.valgrind fedora x86_64'
624 TEST_SUITE: "check.gst-plugins-good\\..*"
625 # take longer time due to splitmux unit test
628 - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-ci|gst-devtools)$/'
631 extends: '.valgrind fedora x86_64'
633 TEST_SUITE: "check.gst-plugins-ugly\\..*"
635 - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-ugly|gst-ci|gst-devtools)$/'
638 extends: '.valgrind fedora x86_64'
640 TEST_SUITE: "check.gst-plugins-bad\\..*"
642 - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-plugins-bad|gst-ci|gst-devtools)$/'
645 extends: '.valgrind fedora x86_64'
647 TEST_SUITE: "check.gst-editing-services\\..*"
649 - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-editing-services|gst-ci|gst-devtools)$/'
651 # Template for Cerbero GStreamer Build
654 # CONFIG: The name of the configuration file to use
655 # ARCH: The cerbero <os>_<cpu> (used in cache key)
659 image: $CERBERO_IMAGE
661 - if: '$CI_PROJECT_NAME == "cerbero"'
664 # Ensure that the runners it will be executed on
665 # will have plenty of space for the cache
669 CCACHE_COMPILERCHECK: "content"
670 CCACHE_COMPRESS: "true"
671 CCACHE_BASEDIR: "/cache/gstreamer/cerbero/"
672 CCACHE_DIR: "/cache/gstreamer/cerbero/ccache/"
673 # shared across everything really
674 CCACHE_MAXSIZE: "50G"
676 CERBERO_HOME: "cerbero-build"
677 CERBERO_SOURCES: "cerbero-sources"
678 CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS}"
679 CERBERO: "./cerbero-uninstalled -c config/${CONFIG} -c localconf.cbc -m manifest.xml"
680 CERBERO_PACKAGE_ARGS: "-t"
681 CERBERO_RUN_WRAPPER: "" # 'wine' on cross-winXX
682 CERBERO_RUN_SUFFIX: "" # '.exe' on cross-winXX
684 # used by macos packages as we only ever install to a fixed directory
685 CERBERO_OVERRIDDEN_DIST_DIR: ""
686 # location where the cerbero git repo is stored on the image
687 CERBERO_HOST_DIR: "/cerbero/"
689 - echo "Fetching ${CERBERO_SCRIPT_URL}"
690 - curl -L -o cerbero_script.sh "${CERBERO_SCRIPT_URL}"
691 - chmod +x cerbero_script.sh
692 - ./cerbero_script.sh cerbero_before_script
694 - ./cerbero_script.sh cerbero_script
696 key: "${CI_JOB_NAME}"
698 - "${CERBERO_SOURCES}"
700 name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
705 - "${CERBERO_HOME}/logs"
709 image: $WINDOWS_IMAGE
720 ${DEFAULT_MESON_ARGS}
726 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs|gstreamer-vaapi)$/'
728 # Sometimes there's seems to be an existing gst-build clone that comes either from the ether or
729 # from a previous job due to some gitlab bug or implicit behavior?
730 # So let's always check and clear it out if its there
731 # https://gitlab.freedesktop.org/tpm/gstreamer-sharp/-/jobs/1672137
732 - if (Test-Path $env:CI_PROJECT_DIR/gst-build) { Remove-Item -Recurse -Force $env:CI_PROJECT_DIR/gst-build }
734 # Make sure powershell exists on errors
735 # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
736 - $ErrorActionPreference = "Stop"
738 - Invoke-WebRequest -Uri "https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/$env:GST_UPSTREAM_BRANCH/gitlab/clone_manifest_ref.py" -OutFile $env:CI_PROJECT_DIR/clone_manifest_ref.py
739 - python clone_manifest_ref.py --manifest manifest.xml --project gst-build --destination $env:CI_PROJECT_DIR/gst-build
740 - cd $env:CI_PROJECT_DIR/gst-build
742 - cp -r C:/subprojects/* subprojects/
743 # Run the git-update script and feed it the manifest to setup the environment
744 - cd $env:CI_PROJECT_DIR/gst-build; python git-update --no-interaction --manifest=$env:CI_PROJECT_DIR/manifest.xml
745 # For some reason, options are separated by newline instead of space, so we
746 # have to replace them first.
747 - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
748 # Gitlab executes PowerShell in docker, but VsDevCmd.bat is a batch script.
749 # Environment variables substitutions is done by PowerShell before calling
750 # cmd.exe, that's why we use $env:FOO instead of %FOO%
751 - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
752 meson build $env:MESON_ARGS &&
754 # XXX: Re-enable when uploading stops timing out
756 # expire_in: "7 days"
759 # - 'gst-build/build/meson-logs/'
762 extends: '.build windows'
767 extends: '.build windows'
772 extends: '.build windows'
775 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs|gstreamer-vaapi)$/'
779 # Sometimes there's seems to be an existing gst-build clone that comes either from the ether or
780 # from a previous job due to some gitlab bug or implicit behavior?
781 # So let's always check and clear it out if its there
782 # https://gitlab.freedesktop.org/tpm/gstreamer-sharp/-/jobs/1672137
783 - if (Test-Path $env:CI_PROJECT_DIR/gst-build) { Remove-Item -Recurse -Force $env:CI_PROJECT_DIR/gst-build }
785 # Make sure powershell exists on errors
786 # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
787 - $ErrorActionPreference = "Stop"
789 # For some reason docker build hangs if this is included in the image, needs more troubleshooting
790 - $env:PATH += ';C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\msys64\mingw32\bin'
791 # Copied from https://github.com/msys2/setup-msys2/blob/master/main.js#L98
792 - C:\msys64\usr\bin\bash -c "pacman-key --init && pacman-key --populate msys2 && pacman-key --refresh-keys || true"
793 - C:\msys64\usr\bin\bash -c "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf"
794 - echo "Updating MSYS2"
795 - C:\msys64\usr\bin\bash -c "pacman -Syuu --noconfirm || echo Update failed, ignoring"
796 - echo "Killing all MSYS2 processes"
797 - taskkill /F /FI "MODULES eq msys-2.0.dll"
798 - echo "Completing MSYS2 update"
799 - C:\msys64\usr\bin\bash -c "pacman -Suu --noconfirm"
800 - echo "Installing needed MSYS2 packages"
801 - C:\msys64\usr\bin\bash -c "pacman -Sy --noconfirm --needed mingw-w64-x86_64-toolchain ninja"
803 - Invoke-WebRequest -Uri "https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/$env:GST_UPSTREAM_BRANCH/gitlab/clone_manifest_ref.py" -OutFile $env:CI_PROJECT_DIR/clone_manifest_ref.py
804 - python clone_manifest_ref.py --manifest manifest.xml --project gst-build --destination $env:CI_PROJECT_DIR/gst-build
805 - cd $env:CI_PROJECT_DIR/gst-build
807 - cp -r C:\subprojects\* subprojects\
809 # Run the git-update script and feed it the manifest to setup the environment
810 - cd $env:CI_PROJECT_DIR/gst-build; python git-update --no-interaction --manifest=$env:CI_PROJECT_DIR/manifest.xml
811 # For some reason, options are separated by newline instead of space, so we
812 # have to replace them first.
813 - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
814 # Replace forward slashes with backwards so bash doesn't complain
815 - $env:_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\','/')
816 - C:\msys64\usr\bin\bash -c "cd $env:_PROJECT_DIR/gst-build &&
817 meson build $env:MESON_ARGS &&
821 # Template for Cerbero GStreamer Deps
823 # This template is used by cerbero/ project to pre-built the GStreamer
824 # dependencies. When available, the .cerbero jobs will download this artifact
825 # in order to speed up the build.
828 # CONFIG: The name of the configuration file to use
829 # ARCH: The cerbero <os>_<cpu> (used in cache key)
831 # Produce an artifact with the dist/ and .cache along
832 # with the associated build-tools.
836 - if: '$CI_PROJECT_NAME == "cerbero"'
838 - ./cerbero_script.sh cerbero_deps_script
841 # Cerbero Linux X86_64 build
843 cerbero deps fedora x86_64:
844 extends: '.cerbero deps'
846 CONFIG: "linux.config"
849 build cerbero fedora x86_64:
852 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'
854 CONFIG: "linux.config"
857 # Cerbero Android Universal build
859 .cerbero cross-android universal:
861 CONFIG: "cross-android-universal.cbc"
862 ARCH: "android_universal"
864 name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
869 - "${CERBERO_HOME}/logs"
872 cerbero deps cross-android universal:
875 - '.cerbero cross-android universal'
877 build cerbero cross-android universal:
880 - '.cerbero cross-android universal'
882 - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME && $CI_PROJECT_NAME == "gst-docs"'
883 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
886 # Cerbero Cross Windows builds
888 cerbero deps cross-windows x86:
889 extends: '.cerbero deps'
891 CONFIG: "cross-win32.cbc"
894 build cerbero cross win32:
897 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'
899 CONFIG: "cross-win32.cbc"
900 CERBERO_RUN_WRAPPER: "wine"
901 CERBERO_RUN_SUFFIX: ".exe"
904 cerbero deps cross-windows x86_64:
905 extends: '.cerbero deps'
907 CONFIG: "cross-win64.cbc"
910 build cerbero cross win64:
913 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'
915 CONFIG: "cross-win64.cbc"
916 CERBERO_RUN_WRAPPER: "wine"
917 CERBERO_RUN_SUFFIX: ".exe"
920 # Build an Android App using the android binaries
922 .cross-android universal examples:
923 image: $ANDROID_IMAGE
926 EXAMPLES_HOME: ${CI_PROJECT_DIR}/examples
927 GSTREAMER_ROOT_ANDROID: ${CI_PROJECT_DIR}/examples/cerbero-android-universal
929 - mkdir -p ${EXAMPLES_HOME}/outputs
930 - curl -L -o clone_manifest_ref.py https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/clone_manifest_ref.py
931 - chmod +x clone_manifest_ref.py
932 - ./clone_manifest_ref.py --manifest manifest.xml --project gst-examples --destination ${EXAMPLES_HOME}/gst-examples
933 - ./clone_manifest_ref.py --manifest manifest.xml --project gst-docs --destination ${EXAMPLES_HOME}/gst-docs
934 - rm clone_manifest_ref.py
936 # extract our binaries
937 - rm -f gstreamer-1.0-android-universal-*-runtime.tar.*
938 - mkdir ${GSTREAMER_ROOT_ANDROID}
939 - time tar -C ${GSTREAMER_ROOT_ANDROID} -xf gstreamer-1.0-android-universal-*.tar.*
941 # gst-examples - player
942 - chmod +x ${EXAMPLES_HOME}/gst-examples/playback/player/android/gradlew
943 - ${EXAMPLES_HOME}/gst-examples/playback/player/android/gradlew --no-daemon --project-dir ${EXAMPLES_HOME}/gst-examples/playback/player/android assembleDebug
944 - cp ${EXAMPLES_HOME}/gst-examples/playback/player/android/app/build/outputs/apk/debug/*.apk ${EXAMPLES_HOME}/outputs/
946 # gst-examples - vulkan
947 - chmod +x ${EXAMPLES_HOME}/gst-examples/vulkan/android/gradlew
948 - ${EXAMPLES_HOME}/gst-examples/vulkan/android/gradlew --no-daemon --project-dir ${EXAMPLES_HOME}/gst-examples/vulkan/android assembleDebug
949 - cp ${EXAMPLES_HOME}/gst-examples/vulkan/android/build/outputs/apk/debug/*.apk ${EXAMPLES_HOME}/outputs/
951 # gst-docs android tutorials
952 - chmod +x ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android/gradlew
953 - ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android/gradlew --no-daemon --project-dir ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android assembleDebug
954 - cp ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android/android-tutorial-*/build/outputs/apk/debug/*.apk ${EXAMPLES_HOME}/outputs/
956 - rm -rf ${GSTREAMER_ROOT_ANDROID}
957 - rm -rf ${EXAMPLES_HOME}/gst-examples ${EXAMPLES_HOME}/gst-docs
959 name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
964 - "${EXAMPLES_HOME}/outputs"
966 cross-android universal examples:
967 extends: ".cross-android universal examples"
969 - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME && $CI_PROJECT_NAME == "gst-docs"'
970 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
972 - "build cerbero cross-android universal"
974 cerbero cross-android universal examples:
975 extends: ".cross-android universal examples"
977 - if: '$CI_PROJECT_NAME == "cerbero"'
979 - "cerbero deps cross-android universal"
982 # Cerbero macOS X86_64 build
984 .cerbero macos x86_64:
986 ARCH: "darwin_x86_64"
987 CONFIG: "osx-x86-64.cbc"
988 CERBERO_PACKAGE_ARGS: ""
990 CERBERO_OVERRIDDEN_DIST_DIR: "/Library/Frameworks/GStreamer.framework/Versions/1.0"
991 CERBERO_HOST_DIR: "/Users/gst-ci/cerbero/"
995 name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
1000 - "${CERBERO_HOME}/logs"
1001 - "gstreamer-1.0-1.*.pkg"
1002 - "gstreamer-1.0-devel-1.*.pkg"
1004 cerbero deps macos x86_64:
1007 - '.cerbero macos x86_64'
1009 build cerbero macos x86_64:
1012 - '.cerbero macos x86_64'
1014 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gst-sharp|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
1019 .cerbero cross-ios universal:
1021 ARCH: "ios_universal"
1022 CONFIG: "cross-ios-universal.cbc"
1023 CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS} -v nowerror"
1024 CERBERO_PACKAGE_ARGS: ""
1026 CERBERO_HOST_DIR: "/Users/gst-ci/cerbero/"
1030 name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
1035 - "${CERBERO_HOME}/logs"
1036 - "gstreamer-1.0-*-ios-universal.pkg"
1038 cerbero deps cross-ios universal:
1041 - '.cerbero cross-ios universal'
1043 build cerbero cross-ios universal:
1046 - '.cerbero cross-ios universal'
1048 - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME && $CI_PROJECT_NAME == "gst-docs"'
1049 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gst-sharp|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
1052 image: $FEDORA_DOCS_IMAGE
1054 - '.gst_build_ccache_vars'
1056 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-integration-testsuites|gst-plugins-rs|gst-python)$/'
1061 MESON_ARGS: *simple_build
1062 MESON_BUILDTYPE_ARGS: "-Ddoc=enabled"
1063 CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
1065 - pip3 install --upgrade git+https://github.com/hotdoc/hotdoc@28ad9aa59daa49d6b3fd1bc6b144df52af39475b
1067 # FIXME: remove this once the docs image is updated
1068 - rm -rf /gst-build/subprojects/pygobject/
1071 - ./gst-uninstalled.py ninja -C build/ plugins_doc_caches
1073 python3 -c "import os, subprocess, sys
1074 subprojects = [os.environ['CI_PROJECT_NAME']]
1075 if subprojects[0] in ['gst-ci', 'gst-build']:
1076 subprojects = ['gstreamer', 'gst-plugins-ugly', 'gst-omx', 'gst-plugins-good', 'gst-plugins-base', 'gstreamer-vaapi', 'gst-libav', 'gst-editing-services', 'gst-rtsp-server', 'gst-plugins-bad',]
1078 diffsdir = '../plugins-cache-diffs'
1079 os.makedirs(diffsdir, exist_ok=True)
1081 for subproject in subprojects:
1082 cwd = os.path.join('subprojects', subproject)
1084 subprocess.check_call(['git', 'diff', '--quiet'], cwd=cwd)
1085 except subprocess.CalledProcessError:
1086 diffname = os.path.join(diffsdir, '%s_cache.diff' % subproject)
1088 with open(diffname, 'w') as diff:
1089 subprocess.check_call(['git', 'diff'], stdout=diff, cwd=cwd)
1090 print('\033[91mYou have a diff in the %s documentation cache. Please update with:\033[0m' % subproject)
1091 print(' $ curl %s/%s | git apply -' % (os.environ['CI_ARTIFACTS_URL'], diffname.replace('../', '')))
1093 print('(note that it might take a few minutes for artefacts to be available on the server)\n')
1096 - ./gst-uninstalled.py hotdoc run --conf-file=build/subprojects/gst-docs/GStreamer-doc.json --fatal-warnings
1098 - mv gst-build/build/subprojects/gst-docs/GStreamer-doc/html documentation/
1104 - plugins-cache-diffs/
1107 # Build an iOS App using the iOS binaries
1109 .cross-ios universal examples:
1112 EXAMPLES_HOME: ${CI_PROJECT_DIR}/examples
1113 # disable codesigning so we don't need developer identities on the CI
1116 CODE_SIGNING_REQUIRED="NO"
1117 CODE_SIGN_IDENTITY=""
1118 CODE_SIGNING_ALLOWED="NO"
1119 CODE_SIGN_ENTITLEMENTS=""
1121 # install the binaries
1122 - installer -pkg gstreamer-1.0-devel-*-ios-universal.pkg -target CurrentUserHomeDirectory -verbose
1124 - curl -L -o clone_manifest_ref.py https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/clone_manifest_ref.py
1125 - chmod +x clone_manifest_ref.py
1126 - ./clone_manifest_ref.py --manifest manifest.xml --project gst-examples --destination ${EXAMPLES_HOME}/gst-examples
1127 - ./clone_manifest_ref.py --manifest manifest.xml --project gst-docs --destination ${EXAMPLES_HOME}/gst-docs
1128 - rm clone_manifest_ref.py
1130 # dump some useful information
1131 - xcodebuild -version
1132 - xcodebuild -showsdks
1134 # gst-docs ios tutorials
1135 - xcodebuild -showBuildSettings -alltargets -project ${EXAMPLES_HOME}/gst-docs/examples/tutorials/xcode\ iOS/GStreamer\ iOS\ Tutorials.xcodeproj
1136 - xcodebuild -alltargets -destination generic/platform=iOS -project ${EXAMPLES_HOME}/gst-docs/examples/tutorials/xcode\ iOS/GStreamer\ iOS\ Tutorials.xcodeproj ${XCODE_BUILD_ARGS}
1139 - xcodebuild -showBuildSettings -alltargets -project ${EXAMPLES_HOME}/gst-examples/playback/player/ios/GstPlay.xcodeproj
1140 - xcodebuild -alltargets -destination generic/platform=iOS -project ${EXAMPLES_HOME}/gst-examples/playback/player/ios/GstPlay.xcodeproj ${XCODE_BUILD_ARGS}
1142 - rm -rf ${EXAMPLES_HOME}/gst-examples ${EXAMPLES_HOME}/gst-docs
1146 cross-ios universal examples:
1147 extends: ".cross-ios universal examples"
1149 - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME && $CI_PROJECT_NAME == "gst-docs"'
1150 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
1152 - "build cerbero cross-ios universal"
1154 cerbero cross-ios universal examples:
1155 extends: ".cross-ios universal examples"
1157 - if: '$CI_PROJECT_NAME == "cerbero"'
1159 - "cerbero deps cross-ios universal"
1161 build gst-omx zynq fedora x86_64:
1162 extends: '.build fedora x86_64'
1164 MESON_ARGS: "-Domx=enabled -Dgst-omx:target=zynqultrascaleplus -Dgst-omx:header_path=${CI_PROJECT_DIR}/vcu-omx-il/omx_header -Dpython=disabled -Dlibav=disabled -Dlibnice=disabled -Dugly=disabled -Dbad=disabled -Ddevtools=disabled -Dges=disabled -Drtsp_server=disabled -Dvaapi=disabled -Dsharp=disabled -Dgst-examples=disabled -Drs=disabled ${MESON_BUILDTYPE_ARGS} $MESON_GST_WERROR"
1166 - if: '$CI_PROJECT_NAME =~ /^(gst-omx|gst-ci)$/'
1168 - git clone https://github.com/Xilinx/vcu-omx-il.git --branch=release-2020.1 ${CI_PROJECT_DIR}/vcu-omx-il
1170 build gst-omx tizonia fedora x86_64:
1171 extends: '.build fedora x86_64'
1173 MESON_ARGS: "-Domx=enabled -Dgst-omx:target=tizonia -Dpython=disabled -Dlibav=disabled -Dlibnice=disabled -Dugly=disabled -Dbad=disabled -Ddevtools=disabled -Dges=disabled -Drtsp_server=disabled -Dvaapi=disabled -Dsharp=disabled -Dgst-examples=disabled -Drs=disabled ${MESON_BUILDTYPE_ARGS} $MESON_GST_WERROR"
1174 PKG_CONFIG_PATH: ${PKG_CONFIG_PATH}:${CI_PROJECT_DIR}/tizonia-install/lib64/pkgconfig/
1176 - if: '$CI_PROJECT_NAME =~ /^(gst-omx|gst-ci)$/'
1178 - git clone https://github.com/tizonia/tizonia-openmax-il --branch v0.20.2
1179 - cd tizonia-openmax-il
1180 - meson build -Dclients=false -Dplugins='' -Dplayer=false -Dprefix=${CI_PROJECT_DIR}/tizonia-install
1182 - ninja -C build install
1186 # Cerbero Native Windows builds
1188 .cerbero windows native:
1190 image: $WINDOWS_IMAGE
1194 - 'gstreamer-windows'
1199 CERBERO_HOST_DIR: "C:/cerbero"
1200 CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS} -v visualstudio -v nowerror"
1201 CERBERO_RUN_SUFFIX: ".exe"
1203 # FIXME: for some reason the runner is hanging when trying to upload artifacts
1207 - $env:CI_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\', '/')
1208 - $env:CERBERO_SCRIPTS_PATH = "$env:CI_PROJECT_DIR/cerbero_setup.sh"
1209 - echo "Fetching $env:CERBERO_SCRIPT_URL"
1210 - Invoke-WebRequest -Uri $env:CERBERO_SCRIPT_URL -OutFile $env:CERBERO_SCRIPTS_PATH
1211 - C:\MinGW\msys\1.0\bin\bash.exe --login -c "cd $env:CI_PROJECT_DIR && $env:CERBERO_SCRIPTS_PATH cerbero_before_script"
1213 cerbero deps msvc x86_64:
1214 extends: ['.cerbero deps', '.cerbero windows native']
1216 - C:\MinGW\msys\1.0\bin\bash.exe --login -c "cd $env:CI_PROJECT_DIR && $env:CERBERO_SCRIPTS_PATH cerbero_deps_script"
1218 build cerbero msvc x86_64:
1219 extends: ['.cerbero', '.cerbero windows native']
1221 - C:\MinGW\msys\1.0\bin\bash.exe --login -c "cd $env:CI_PROJECT_DIR && $env:CERBERO_SCRIPTS_PATH cerbero_script"
1223 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'