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 # FIXME: after merging the script
51 # CERBERO_SCRIPT_URL: "https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/cerbero_setup.sh"
52 CERBERO_SCRIPT_URL: 'https://gitlab.freedesktop.org/alatiera/gst-ci/-/raw/alatiera/cerbero-windows-attempt-6/gitlab/cerbero_setup.sh'
55 MESON_BUILDTYPE_ARGS: --default-library=both
57 -Dlibnice:tests=disabled
58 -Dlibnice:examples=disabled
59 -Dopenh264:tests=disabled
60 -Dpygobject:tests=false
72 -Dgstreamer:werror=true
73 -Dgst-plugins-base:werror=true
74 -Dgst-plugins-good:werror=true
75 -Dgst-plugins-ugly:werror=true
76 -Dgst-plugins-bad:werror=true
77 -Dgst-rtsp-server:werror=true
78 -Dgst-libav:werror=true
79 -Dgst-examples:werror=true
80 -Dgst-editing-services:werror=true
81 -Dgst-docs:werror=true
83 -Dgst-devtools:werror=true
84 -Dgst-python:werror=true
85 -Dgstreamer-vaapi:werror=true
86 -Dgstreamer-sharp:werror=true
88 DEFAULT_CERBERO_ARGS: >
95 # This can be used to configure global behaviour our our jobs.
101 - 'runner_system_failure'
102 - 'stuck_or_timeout_failure'
103 - 'scheduler_failure'
108 # Script to check if a docker image exists in the upstream registry
109 # and if so copy it to the forked registry so we can use it
111 # This is copied/adapted from citemplates/templates/fedora.yml
112 # https://gitlab.freedesktop.org/freedesktop/ci-templates/-/blob/96b621fe9f57ec2464f8d1a0940446afbf6c8f59/templates/fedora.yml
113 .check_image: &check_image_exists |
114 # if-not-exists steps
117 if [[ -z "$GST_FORCE_REBUILD" ]]
119 # disable exit on failure
122 # check if our image is already in the current registry
123 # we store the sha of the digest and the layers
124 skopeo inspect docker://$LOCAL_IMAGE | jq '[.Digest, .Layers]' > local_sha
126 # check if our image is already in our gst-ci registry fork
127 skopeo inspect docker://$LOCAL_GST_CI_IMAGE | jq '[.Digest, .Layers]' > local_gst_ci_sha
129 # check if our image is already in the upstream registry
130 if [[ -z "$GST_UPSTREAM_REPO" ]]
132 echo "WARNING! Variable \$GST_UPSTREAM_REPO is undefined, cannot check for images"
134 skopeo inspect docker://$GST_UPSTREAM_IMAGE | jq '[.Digest, .Layers]' > upstream_sha
137 # reenable exit on failure
140 # if the upstream repo has an image, ensure we use the same
141 if [ -s upstream_sha ]
144 echo "Checking if $LOCAL_IMAGE is up to date"
145 # ensure we use the same image from upstream
146 diff upstream_sha local_sha && exit 0 || true
148 echo "Copying image from gstreamer/gst-ci to local registry"
149 # copy the original image into the current project registry namespace
150 # we do 2 attempts with skopeo copy at most
151 skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
152 docker://$GST_UPSTREAM_IMAGE \
153 docker://$LOCAL_IMAGE || \
154 skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
155 docker://$GST_UPSTREAM_IMAGE \
156 docker://$LOCAL_IMAGE
163 # if the local ci fork repo has an image, ensure we use the same
164 if [ -s local_gst_ci_sha ]
166 echo "Checking if $LOCAL_GST_CI_IMAGE is up to date"
167 # ensure we use the same image from upstream
168 diff local_gst_ci_sha local_sha && exit 0 || true
170 echo "Copying image from $CI_PROJECT_NAMESPACE/gst-ci to local registry"
171 # copy the original image into the current project registry namespace
172 # we do 2 attempts with skopeo copy at most
173 skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
174 docker://$LOCAL_GST_CI_IMAGE \
175 docker://$LOCAL_IMAGE || \
176 skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
177 docker://$LOCAL_GST_CI_IMAGE \
178 docker://$LOCAL_IMAGE
183 # if we have a local image but none in the upstream repo, use our
186 echo "Using $LOCAL_IMAGE"
192 # Build docker images from Dockerfiles
194 # This is copied/adapted from citemplates/templates/fedora.yml
195 # https://gitlab.freedesktop.org/freedesktop/ci-templates/-/blob/96b621fe9f57ec2464f8d1a0940446afbf6c8f59/templates/fedora.yml
197 # CITemplates builds uses buildah run/commit workflow to build the images which doesn't
198 # fit us atm and our images need further adjustment to make use of it. Porting to
199 # ci-templates is the next step though.
201 # All the documentation from citemplates should be applicable here, so please refer there
203 image: "$CI_REGISTRY/freedesktop/ci-templates/buildah:2020-07-20.1"
205 STORAGE_DRIVER: 'vfs'
206 BUILDAH_FORMAT: 'docker'
207 BUILDAH_ISOLATION: 'chroot'
211 - export LOCAL_IMAGE="$CI_REGISTRY_IMAGE/$REPO_SUFFIX:$TAG"
212 - export LOCAL_GST_CI_IMAGE="$CI_REGISTRY/$CI_PROJECT_NAMESPACE/gst-ci/$REPO_SUFFIX:$TAG"
213 - export GST_UPSTREAM_IMAGE="$CI_REGISTRY/$GST_UPSTREAM_REPO/$REPO_SUFFIX:$TAG"
215 # check if the docker registry is enabled, else the variable will be missing
217 if [[ -z "$CI_REGISTRY_IMAGE" ]]
219 echo "ERROR! Looks like your repository/fork has disabled Docker Registries."
220 echo "Pleae enable them by following the documentation from here:"
221 echo "https://docs.gitlab.com/ee/user/packages/container_registry/#enable-the-container-registry-for-your-project"
225 # Newer versions of podman/buildah try to set overlayfs mount options when
226 # using the vfs driver, and this causes errors.
227 - sed -i '/^mountopt =.*/d' /etc/containers/storage.conf
229 - *check_image_exists
231 # This part of the job should only ever be possible to be reach in a gst-ci fork
233 if [[ "$CI_PROJECT_NAME" != 'gst-ci' ]]
235 echo "ERROR! Something is wrong!"
236 echo "This part of the job is supposed to be executed only in gst-ci forks, and its probably going to fail else"
240 - echo "Building image $LOCAL_IMAGE"
244 --build-arg DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH
245 --label ci.job_id=$CI_JOB_ID
246 --label pipeline.url=$CI_PIPELINE_URL
247 --label git.ref_name=$CI_COMMIT_REF_NAME
248 --label git.sha=$CI_COMMIT_SHA
249 --label gitlab.project_path=$CI_PROJECT_PATH
250 --label gitlab.project_url=$CI_PROJECT_URL
251 --label fdo.upstream-repo=$GST_UPSTREAM_REPO
252 --label fdo.expires-after="3w"
257 - buildah login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
261 if [ "$CI_PROJECT_PATH" = "gstreamer/gst-ci" ]; then
262 if [ "$LOCAL_IMAGE" != "$GST_UPSTREAM_IMAGE" ]; then
263 echo "ERROR!!! AAAAA! THE IMAGE URI DOES NOT MATCH THE EXPECTED UPSTREAM ONE"
265 echo $GST_UPSTREAM_IMAGE
270 - buildah push $LOCAL_IMAGE
273 stage: "build docker"
275 REPO_SUFFIX: "$FEDORA_AMD64_SUFFIX"
276 TAG: "$FEDORA_TAG-$GST_UPSTREAM_BRANCH"
278 CONTEXT_DIR: "./docker/fedora/"
279 DOCKERFILE: "docker/fedora/Dockerfile"
282 cerbero fedora amd64 docker:
283 stage: "build docker"
285 REPO_SUFFIX: "$CERBERO_AMD64_SUFFIX"
286 TAG: "$CERBERO_TAG-$GST_UPSTREAM_BRANCH"
288 CONTEXT_DIR: "docker/cerbero/"
289 DOCKERFILE: "docker/cerbero/Dockerfile-fedora"
293 stage: "build docker"
295 REPO_SUFFIX: "$ANDROID_AMD64_SUFFIX"
296 TAG: "$ANDROID_TAG-$GST_UPSTREAM_BRANCH"
298 CONTEXT_DIR: "docker/android/"
299 DOCKERFILE: "docker/android/Dockerfile"
302 alpine amd64 manifest builder docker:
303 stage: "build docker"
305 REPO_SUFFIX: "$MANIFEST_AMD64_SUFFIX"
306 TAG: '$MANIFEST_TAG-$GST_UPSTREAM_BRANCH'
308 CONTEXT_DIR: "docker/build_manifest/"
309 DOCKERFILE: "docker/build_manifest/Dockerfile"
312 gst-indent amd64 docker:
313 stage: "build docker"
315 REPO_SUFFIX: "$INDENT_AMD64_SUFFIX"
316 TAG: "$INDENT_TAG-$GST_UPSTREAM_BRANCH"
318 CONTEXT_DIR: "docker/indent/"
319 DOCKERFILE: "docker/indent/Dockerfile"
323 # Job to create the manifest.xml to used for our builds
326 image: $MANIFEST_IMAGE
328 # Always have automatic pipeline for branchs in cerbero and docs
329 # cause they need to update artifacts, like the docs site or cerbero deps
330 - if: '$CI_PROJECT_PATH == "gstreamer/cerbero"'
331 - if: '$CI_PROJECT_PATH == "gstreamer/gst-docs"'
333 # If the user that triggered the Pipeline is the Merge bot and the branch doesn't match
334 # the upstream branch set, run the pipeline
335 - if: '$GITLAB_USER_LOGIN == "gstreamer-merge-bot" && $CI_COMMIT_BRANCH != "$GST_UPSTREAM_BRANCH"'
336 # When the user isn't the merge bot, require an explicit action to trigger the pipeline
337 # to avoid wasting CI resources
338 - if: '$GITLAB_USER_LOGIN != "gstreamer-merge-bot"'
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_COMMIT_BRANCH == "$GST_UPSTREAM_BRANCH"'
348 - gitlab/build_manifest.py --self-update
349 - gitlab/build_manifest.py ${CI_PROJECT_DIR}/manifest.xml
350 - cat ${CI_PROJECT_DIR}/manifest.xml
363 GIT_STRATEGY: 'fetch'
365 - if: '$CI_PROJECT_NAME !~ /^(gstreamer-sharp|gst-integration-testsuites|cerbero|gst-docs)$/'
367 # man indent. grep RETURN VALUE, grab a beer on my behalf...
368 - indent --version || true
371 if test -f ".indentignore"; then
373 while read -r line; do
374 if test -n "$line"; then
375 filter_args+=("-e" "$line")
377 done < ".indentignore"
378 if [[ ${#filter_args[@]} -gt 0 ]]; then
379 filter_cmd=("grep" "-v" "${filter_args[@]}")
382 find . -name '*.c' | "${filter_cmd[@]}" | xargs -d '\n' gst-indent
384 if git diff --quiet; then
385 echo "Code is properly formatted"
387 git diff --color=always
388 echo 'style diverges, please run gst-indent first'
393 # gst-build setup templates
395 .gst_build_template: &gst_build
397 # Sometimes, gitlab-runner want to reuse
398 # existing docker volumes without cleaning them up...
399 # Make sure the docker volume is clean
400 - rm -rf gst-build || true
401 - rm -rf meson-logs || true
402 - rm -rf validate-logs || true
404 - curl -L -o clone_manifest_ref.py "https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/clone_manifest_ref.py"
405 - python3 clone_manifest_ref.py --manifest manifest.xml --project gst-build --destination gst-build
407 # only copy immediate directories. We don't want to modify .wrap files
408 - find /gst-build/subprojects/ -mindepth 1 -maxdepth 1 -type d -exec cp -r \{\} subprojects/ \;
409 - ./git-update --no-interaction --manifest="${CI_PROJECT_DIR}/manifest.xml"
410 - meson build/ $MESON_ARGS
412 - ccache --show-stats
414 .gst_build_ccache_vars:
416 CCACHE_COMPILERCHECK: 'content'
417 CCACHE_COMPRESS: 'true'
418 CCACHE_BASEDIR: '/cache/gstreamer/gst-build'
419 CCACHE_DIR: '/cache/gstreamer/gst-build/ccache/'
420 # shared across everything really
421 CCACHE_MAXSIZE: '10G'
422 CARGO_HOME: '/cache/gstreamer/cargo'
424 .simple_fedora_build: &simple_build >-
425 ${DEFAULT_MESON_ARGS}
428 -Dgst-omx:target=generic
431 ${MESON_BUILDTYPE_ARGS}
437 - '.gst_build_ccache_vars'
440 # Taking into account the slowest shared runner + time needed to upload the binaries to artifacts
441 # Also need to take into account I/O of pulling docker images and uploading artifacts
444 MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
446 - if: '$CI_PROJECT_NAME != "cerbero"'
450 - mv gst-build/build/meson-logs/ meson-logs
451 # Cleanup everything else to reduce the size
452 # of the docker volume we leave behind
461 .build fedora x86_64:
465 MESON_ARGS: *simple_build
467 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-omx|gst-plugins-rs)$/'
469 build nodebug fedora x86_64:
473 MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
475 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
477 build static fedora x86_64:
478 extends: '.build fedora x86_64'
480 MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
482 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
484 build static nodebug fedora x86_64:
485 extends: 'build nodebug fedora x86_64'
487 MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
489 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
491 build clang fedora x86_64:
492 extends: '.build fedora x86_64'
495 CXX: 'ccache clang++'
497 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
502 - '.gst_build_ccache_vars'
506 MESON_ARGS: *simple_build
508 # Disable colored output to avoid weird rendering issues
509 GST_DEBUG_NO_COLOR: "true"
510 CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/validate-logs/"
511 GST_VALIDATE_LAUNCHER_FORCE_COLORS: "true"
513 CARGO_HOME: "/cache/gstreamer/cargo"
515 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-examples|gst-docs)$/'
519 - echo "-> Running ${TEST_SUITE}"
522 gst-validate-launcher ${TEST_SUITE}
528 --timeout-factor "${TIMEOUT_FACTOR}"
529 --fail-on-testlist-change
530 -l "${CI_PROJECT_DIR}/validate-logs/"
531 --xunit-file "${CI_PROJECT_DIR}/validate-logs/xunit.xml"
532 ${EXTRA_VALIDATE_ARGS}
534 - mv gst-build/build/meson-logs/ meson-logs
535 # Cleanup everything else to reduce the size
536 # of the docker volume we leave behind
547 - "validate-logs/*.xml"
555 extends: '.test fedora x86_64'
557 TEST_SUITE: "check.gst*"
559 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
561 integration testsuites fedora:
562 extends: '.test fedora x86_64'
565 EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --check-bugs --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX}"
566 TEST_SUITE: "validate ges"
568 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-examples|gst-omx|gstreamer-sharp|gst-plugins-rs)$/'
571 extends: 'build static fedora x86_64'
575 --default-library=static
576 -Dauto_features=disabled
577 -Dgst-plugins-good:alpha=enabled
580 - if: '$CI_PROJECT_NAME =~ /^(gst-build|gst-ci)$/'
584 - ninja -C build install
585 - export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib64/gstreamer-1.0/pkgconfig
586 - export LD_LIBRARY_PATH=/usr/local/lib64
587 - cd examples/static-plugins
590 - meson test -C _build -v
595 - 'gst-build/build/meson-logs/'
596 - 'gst-build/build/gstinitstaticplugins.c'
599 .valgrind fedora x86_64:
600 extends: '.test fedora x86_64'
603 EXTRA_VALIDATE_ARGS: "--valgrind"
606 extends: '.valgrind fedora x86_64'
608 TEST_SUITE: "check.gstreamer\\..*"
610 - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-ci|gst-devtools)$/'
613 extends: '.valgrind fedora x86_64'
615 TEST_SUITE: "check.gst-plugins-base\\..*"
617 - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-ci|gst-devtools)$/'
620 extends: '.valgrind fedora x86_64'
622 TEST_SUITE: "check.gst-plugins-good\\..*"
623 # take longer time due to splitmux unit test
626 - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-ci|gst-devtools)$/'
629 extends: '.valgrind fedora x86_64'
631 TEST_SUITE: "check.gst-plugins-ugly\\..*"
633 - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-ugly|gst-ci|gst-devtools)$/'
636 extends: '.valgrind fedora x86_64'
638 TEST_SUITE: "check.gst-plugins-bad\\..*"
640 - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-plugins-bad|gst-ci|gst-devtools)$/'
643 extends: '.valgrind fedora x86_64'
645 TEST_SUITE: "check.gst-editing-services\\..*"
647 - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-editing-services|gst-ci|gst-devtools)$/'
649 # Template for Cerbero GStreamer Build
652 # CONFIG: The name of the configuration file to use
653 # ARCH: The cerbero <os>_<cpu> (used in cache key)
657 image: $CERBERO_IMAGE
659 - if: '$CI_PROJECT_NAME == "cerbero"'
662 # Ensure that the runners it will be executed on
663 # will have plenty of space for the cache
667 CCACHE_COMPILERCHECK: "content"
668 CCACHE_COMPRESS: "true"
669 CCACHE_BASEDIR: "/cache/gstreamer/cerbero/"
670 CCACHE_DIR: "/cache/gstreamer/cerbero/ccache/"
671 # shared across everything really
672 CCACHE_MAXSIZE: "50G"
674 CERBERO_HOME: "cerbero-build"
675 CERBERO_SOURCES: "cerbero-sources"
676 CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS}"
677 CERBERO: "./cerbero-uninstalled -c config/${CONFIG} -c localconf.cbc -m manifest.xml"
678 CERBERO_PACKAGE_ARGS: "-t"
679 CERBERO_RUN_WRAPPER: "" # 'wine' on cross-winXX
680 CERBERO_RUN_SUFFIX: "" # '.exe' on cross-winXX
682 # used by macos packages as we only ever install to a fixed directory
683 CERBERO_OVERRIDDEN_DIST_DIR: ""
684 # location where cerbero is cached on the host
685 CERBERO_HOST_DIR: "/cerbero/"
687 - curl -L -o cerbero_script.sh "${CERBERO_SCRIPT_URL}"
688 - chmod +x cerbero_script.sh
689 - ./cerbero_script.sh cerbero_before_script
691 - ./cerbero_script.sh cerbero_script
693 key: "${CI_JOB_NAME}"
695 - "${CERBERO_SOURCES}"
697 name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
702 - "${CERBERO_HOME}/logs"
706 image: $WINDOWS_IMAGE
717 ${DEFAULT_MESON_ARGS}
723 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs|gstreamer-vaapi)$/'
725 # Sometimes there's seems to be an existing gst-build clone that comes either from the ether or
726 # from a previous job due to some gitlab bug or implicit behavior?
727 # So let's always check and clear it out if its there
728 # https://gitlab.freedesktop.org/tpm/gstreamer-sharp/-/jobs/1672137
729 - if (Test-Path $env:CI_PROJECT_DIR/gst-build) { Remove-Item -Recurse -Force $env:CI_PROJECT_DIR/gst-build }
731 # Make sure powershell exists on errors
732 # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
733 - $ErrorActionPreference = "Stop"
735 - 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
736 - python clone_manifest_ref.py --manifest manifest.xml --project gst-build --destination $env:CI_PROJECT_DIR/gst-build
737 - cd $env:CI_PROJECT_DIR/gst-build
739 - cp -r C:/subprojects/* subprojects/
740 # Run the git-update script and feed it the manifest to setup the environment
741 - cd $env:CI_PROJECT_DIR/gst-build; python git-update --no-interaction --manifest=$env:CI_PROJECT_DIR/manifest.xml
742 # For some reason, options are separated by newline instead of space, so we
743 # have to replace them first.
744 - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
745 # Gitlab executes PowerShell in docker, but VsDevCmd.bat is a batch script.
746 # Environment variables substitutions is done by PowerShell before calling
747 # cmd.exe, that's why we use $env:FOO instead of %FOO%
748 - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
749 meson build $env:MESON_ARGS &&
751 # XXX: Re-enable when uploading stops timing out
753 # expire_in: "7 days"
756 # - 'gst-build/build/meson-logs/'
759 extends: '.build windows'
764 extends: '.build windows'
769 extends: '.build windows'
772 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs|gstreamer-vaapi)$/'
776 # Sometimes there's seems to be an existing gst-build clone that comes either from the ether or
777 # from a previous job due to some gitlab bug or implicit behavior?
778 # So let's always check and clear it out if its there
779 # https://gitlab.freedesktop.org/tpm/gstreamer-sharp/-/jobs/1672137
780 - if (Test-Path $env:CI_PROJECT_DIR/gst-build) { Remove-Item -Recurse -Force $env:CI_PROJECT_DIR/gst-build }
782 # Make sure powershell exists on errors
783 # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
784 - $ErrorActionPreference = "Stop"
786 # For some reason docker build hangs if this is included in the image, needs more troubleshooting
787 - $env:PATH += ';C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\msys64\mingw32\bin'
788 # Copied from https://github.com/msys2/setup-msys2/blob/master/main.js#L98
789 - C:\msys64\usr\bin\bash -c "pacman-key --init && pacman-key --populate msys2 && pacman-key --refresh-keys || true"
790 - C:\msys64\usr\bin\bash -c "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf"
791 - echo "Updating MSYS2"
792 - C:\msys64\usr\bin\bash -c "pacman -Syuu --noconfirm || echo Update failed, ignoring"
793 - echo "Killing all MSYS2 processes"
794 - taskkill /F /FI "MODULES eq msys-2.0.dll"
795 - echo "Completing MSYS2 update"
796 - C:\msys64\usr\bin\bash -c "pacman -Suu --noconfirm"
797 - echo "Installing needed MSYS2 packages"
798 - C:\msys64\usr\bin\bash -c "pacman -Sy --noconfirm --needed mingw-w64-x86_64-toolchain ninja"
800 - 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
801 - python clone_manifest_ref.py --manifest manifest.xml --project gst-build --destination $env:CI_PROJECT_DIR/gst-build
802 - cd $env:CI_PROJECT_DIR/gst-build
804 - cp -r C:\subprojects\* subprojects\
806 # Run the git-update script and feed it the manifest to setup the environment
807 - cd $env:CI_PROJECT_DIR/gst-build; python git-update --no-interaction --manifest=$env:CI_PROJECT_DIR/manifest.xml
808 # For some reason, options are separated by newline instead of space, so we
809 # have to replace them first.
810 - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
811 # Replace forward slashes with backwards so bash doesn't complain
812 - $env:_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\','/')
813 - C:\msys64\usr\bin\bash -c "cd $env:_PROJECT_DIR/gst-build &&
814 meson build $env:MESON_ARGS &&
818 # Template for Cerbero GStreamer Deps
820 # This template is used by cerbero/ project to pre-built the GStreamer
821 # dependencies. When available, the .cerbero jobs will download this artifact
822 # in order to speed up the build.
825 # CONFIG: The name of the configuration file to use
826 # ARCH: The cerbero <os>_<cpu> (used in cache key)
828 # Produce an artifact with the dist/ and .cache along
829 # with the associated build-tools.
833 - if: '$CI_PROJECT_NAME == "cerbero"'
835 - ./cerbero_script.sh cerbero_deps_script
838 # Cerbero Linux X86_64 build
840 cerbero deps fedora x86_64:
841 extends: '.cerbero deps'
843 CONFIG: "linux.config"
846 build cerbero fedora x86_64:
849 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'
851 CONFIG: "linux.config"
854 # Cerbero Android Universal build
856 .cerbero cross-android universal:
858 CONFIG: "cross-android-universal.cbc"
859 ARCH: "android_universal"
861 name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
866 - "${CERBERO_HOME}/logs"
869 cerbero deps cross-android universal:
872 - '.cerbero cross-android universal'
874 build cerbero cross-android universal:
877 - '.cerbero cross-android universal'
879 - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME && $CI_PROJECT_NAME == "gst-docs"'
880 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
883 # Cerbero Cross Windows builds
885 cerbero deps cross-windows x86:
886 extends: '.cerbero deps'
888 CONFIG: "cross-win32.cbc"
891 build cerbero cross win32:
894 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'
896 CONFIG: "cross-win32.cbc"
897 CERBERO_RUN_WRAPPER: "wine"
898 CERBERO_RUN_SUFFIX: ".exe"
901 cerbero deps cross-windows x86_64:
902 extends: '.cerbero deps'
904 CONFIG: "cross-win64.cbc"
907 build cerbero cross win64:
910 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'
912 CONFIG: "cross-win64.cbc"
913 CERBERO_RUN_WRAPPER: "wine"
914 CERBERO_RUN_SUFFIX: ".exe"
917 # Build an Android App using the android binaries
919 .cross-android universal examples:
920 image: $ANDROID_IMAGE
923 EXAMPLES_HOME: ${CI_PROJECT_DIR}/examples
924 GSTREAMER_ROOT_ANDROID: ${CI_PROJECT_DIR}/examples/cerbero-android-universal
926 - mkdir -p ${EXAMPLES_HOME}/outputs
927 - curl -L -o clone_manifest_ref.py https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/clone_manifest_ref.py
928 - chmod +x clone_manifest_ref.py
929 - ./clone_manifest_ref.py --manifest manifest.xml --project gst-examples --destination ${EXAMPLES_HOME}/gst-examples
930 - ./clone_manifest_ref.py --manifest manifest.xml --project gst-docs --destination ${EXAMPLES_HOME}/gst-docs
931 - rm clone_manifest_ref.py
933 # extract our binaries
934 - rm -f gstreamer-1.0-android-universal-*-runtime.tar.*
935 - mkdir ${GSTREAMER_ROOT_ANDROID}
936 - time tar -C ${GSTREAMER_ROOT_ANDROID} -xf gstreamer-1.0-android-universal-*.tar.*
938 # gst-examples - player
939 - chmod +x ${EXAMPLES_HOME}/gst-examples/playback/player/android/gradlew
940 - ${EXAMPLES_HOME}/gst-examples/playback/player/android/gradlew --no-daemon --project-dir ${EXAMPLES_HOME}/gst-examples/playback/player/android assembleDebug
941 - cp ${EXAMPLES_HOME}/gst-examples/playback/player/android/app/build/outputs/apk/debug/*.apk ${EXAMPLES_HOME}/outputs/
943 # gst-examples - vulkan
944 - chmod +x ${EXAMPLES_HOME}/gst-examples/vulkan/android/gradlew
945 - ${EXAMPLES_HOME}/gst-examples/vulkan/android/gradlew --no-daemon --project-dir ${EXAMPLES_HOME}/gst-examples/vulkan/android assembleDebug
946 - cp ${EXAMPLES_HOME}/gst-examples/vulkan/android/build/outputs/apk/debug/*.apk ${EXAMPLES_HOME}/outputs/
948 # gst-docs android tutorials
949 - chmod +x ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android/gradlew
950 - ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android/gradlew --no-daemon --project-dir ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android assembleDebug
951 - cp ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android/android-tutorial-*/build/outputs/apk/debug/*.apk ${EXAMPLES_HOME}/outputs/
953 - rm -rf ${GSTREAMER_ROOT_ANDROID}
954 - rm -rf ${EXAMPLES_HOME}/gst-examples ${EXAMPLES_HOME}/gst-docs
956 name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
961 - "${EXAMPLES_HOME}/outputs"
963 cross-android universal examples:
964 extends: ".cross-android universal examples"
966 - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME && $CI_PROJECT_NAME == "gst-docs"'
967 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
969 - "build cerbero cross-android universal"
971 cerbero cross-android universal examples:
972 extends: ".cross-android universal examples"
974 - if: '$CI_PROJECT_NAME == "cerbero"'
976 - "cerbero deps cross-android universal"
979 # Cerbero macOS X86_64 build
981 .cerbero macos x86_64:
983 ARCH: "darwin_x86_64"
984 CONFIG: "osx-x86-64.cbc"
985 CERBERO_PACKAGE_ARGS: ""
987 CERBERO_OVERRIDDEN_DIST_DIR: "/Library/Frameworks/GStreamer.framework/Versions/1.0"
988 CERBERO_HOST_DIR: "/Users/gst-ci/cerbero/"
992 name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
997 - "${CERBERO_HOME}/logs"
998 - "gstreamer-1.0-1.*.pkg"
999 - "gstreamer-1.0-devel-1.*.pkg"
1001 cerbero deps macos x86_64:
1004 - '.cerbero macos x86_64'
1006 build cerbero macos x86_64:
1009 - '.cerbero macos x86_64'
1011 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gst-sharp|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
1016 .cerbero cross-ios universal:
1018 ARCH: "ios_universal"
1019 CONFIG: "cross-ios-universal.cbc"
1020 CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS} -v nowerror"
1021 CERBERO_PACKAGE_ARGS: ""
1023 CERBERO_HOST_DIR: "/Users/gst-ci/cerbero/"
1027 name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
1032 - "${CERBERO_HOME}/logs"
1033 - "gstreamer-1.0-*-ios-universal.pkg"
1035 cerbero deps cross-ios universal:
1038 - '.cerbero cross-ios universal'
1040 build cerbero cross-ios universal:
1043 - '.cerbero cross-ios universal'
1045 - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME && $CI_PROJECT_NAME == "gst-docs"'
1046 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gst-sharp|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
1049 image: $FEDORA_DOCS_IMAGE
1051 - '.gst_build_ccache_vars'
1053 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-integration-testsuites|gst-plugins-rs|gst-python)$/'
1058 MESON_ARGS: *simple_build
1059 MESON_BUILDTYPE_ARGS: "-Ddoc=enabled"
1060 CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
1062 - pip3 install --upgrade git+https://github.com/hotdoc/hotdoc@28ad9aa59daa49d6b3fd1bc6b144df52af39475b
1064 # FIXME: remove this once the docs image is updated
1065 - rm -rf /gst-build/subprojects/pygobject/
1068 - ./gst-uninstalled.py ninja -C build/ plugins_doc_caches
1070 python3 -c "import os, subprocess, sys
1071 subprojects = [os.environ['CI_PROJECT_NAME']]
1072 if subprojects[0] in ['gst-ci', 'gst-build']:
1073 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',]
1075 diffsdir = '../plugins-cache-diffs'
1076 os.makedirs(diffsdir, exist_ok=True)
1078 for subproject in subprojects:
1079 cwd = os.path.join('subprojects', subproject)
1081 subprocess.check_call(['git', 'diff', '--quiet'], cwd=cwd)
1082 except subprocess.CalledProcessError:
1083 diffname = os.path.join(diffsdir, '%s_cache.diff' % subproject)
1085 with open(diffname, 'w') as diff:
1086 subprocess.check_call(['git', 'diff'], stdout=diff, cwd=cwd)
1087 print('\033[91mYou have a diff in the %s documentation cache. Please update with:\033[0m' % subproject)
1088 print(' $ curl %s/%s | git apply -' % (os.environ['CI_ARTIFACTS_URL'], diffname.replace('../', '')))
1090 print('(note that it might take a few minutes for artefacts to be available on the server)\n')
1093 - ./gst-uninstalled.py hotdoc run --conf-file=build/subprojects/gst-docs/GStreamer-doc.json --fatal-warnings
1095 - mv gst-build/build/subprojects/gst-docs/GStreamer-doc/html documentation/
1101 - plugins-cache-diffs/
1104 # Build an iOS App using the iOS binaries
1106 .cross-ios universal examples:
1109 EXAMPLES_HOME: ${CI_PROJECT_DIR}/examples
1110 # disable codesigning so we don't need developer identities on the CI
1113 CODE_SIGNING_REQUIRED="NO"
1114 CODE_SIGN_IDENTITY=""
1115 CODE_SIGNING_ALLOWED="NO"
1116 CODE_SIGN_ENTITLEMENTS=""
1118 # install the binaries
1119 - installer -pkg gstreamer-1.0-devel-*-ios-universal.pkg -target CurrentUserHomeDirectory -verbose
1121 - curl -L -o clone_manifest_ref.py https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/clone_manifest_ref.py
1122 - chmod +x clone_manifest_ref.py
1123 - ./clone_manifest_ref.py --manifest manifest.xml --project gst-examples --destination ${EXAMPLES_HOME}/gst-examples
1124 - ./clone_manifest_ref.py --manifest manifest.xml --project gst-docs --destination ${EXAMPLES_HOME}/gst-docs
1125 - rm clone_manifest_ref.py
1127 # dump some useful information
1128 - xcodebuild -version
1129 - xcodebuild -showsdks
1131 # gst-docs ios tutorials
1132 - xcodebuild -showBuildSettings -alltargets -project ${EXAMPLES_HOME}/gst-docs/examples/tutorials/xcode\ iOS/GStreamer\ iOS\ Tutorials.xcodeproj
1133 - xcodebuild -alltargets -destination generic/platform=iOS -project ${EXAMPLES_HOME}/gst-docs/examples/tutorials/xcode\ iOS/GStreamer\ iOS\ Tutorials.xcodeproj ${XCODE_BUILD_ARGS}
1136 - xcodebuild -showBuildSettings -alltargets -project ${EXAMPLES_HOME}/gst-examples/playback/player/ios/GstPlay.xcodeproj
1137 - xcodebuild -alltargets -destination generic/platform=iOS -project ${EXAMPLES_HOME}/gst-examples/playback/player/ios/GstPlay.xcodeproj ${XCODE_BUILD_ARGS}
1139 - rm -rf ${EXAMPLES_HOME}/gst-examples ${EXAMPLES_HOME}/gst-docs
1143 cross-ios universal examples:
1144 extends: ".cross-ios universal examples"
1146 - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME && $CI_PROJECT_NAME == "gst-docs"'
1147 - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
1149 - "build cerbero cross-ios universal"
1151 cerbero cross-ios universal examples:
1152 extends: ".cross-ios universal examples"
1154 - if: '$CI_PROJECT_NAME == "cerbero"'
1156 - "cerbero deps cross-ios universal"
1158 build gst-omx zynq fedora x86_64:
1159 extends: '.build fedora x86_64'
1161 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"
1163 - if: '$CI_PROJECT_NAME =~ /^(gst-omx|gst-ci)$/'
1165 - git clone https://github.com/Xilinx/vcu-omx-il.git --branch=release-2020.1 ${CI_PROJECT_DIR}/vcu-omx-il
1167 build gst-omx tizonia fedora x86_64:
1168 extends: '.build fedora x86_64'
1170 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"
1171 PKG_CONFIG_PATH: ${PKG_CONFIG_PATH}:${CI_PROJECT_DIR}/tizonia-install/lib64/pkgconfig/
1173 - if: '$CI_PROJECT_NAME =~ /^(gst-omx|gst-ci)$/'
1175 - git clone https://github.com/tizonia/tizonia-openmax-il --branch v0.20.2
1176 - cd tizonia-openmax-il
1177 - meson build -Dclients=false -Dplugins='' -Dplayer=false -Dprefix=${CI_PROJECT_DIR}/tizonia-install
1179 - ninja -C build install
1183 # Cerbero Native Windows builds
1185 .cerbero windows native:
1187 image: $WINDOWS_IMAGE
1191 - 'gstreamer-windows'
1196 # rsync doesn't like windows paths like `C:/cerbero`
1197 CERBERO_HOST_DIR: "/c/cerbero/"
1198 CERBERO_HOME: "C:/cerbero-build"
1199 CERBERO_SOURCES: "C:/cerbero-sources"
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"
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)$/'