citemplate: add initial cerbero msvc builds
[platform/upstream/gstreamer.git] / gitlab / ci_template.yml
1 include:
2   - template: 'Workflows/Branch-Pipelines.gitlab-ci.yml'
3
4 stages:
5   - 'build docker'
6   - 'preparation'
7   - 'pre-build'
8   - 'build'
9   - 'test'
10   # Use the resulting binaries
11   - 'integrate'
12
13 variables:
14   # Branch to track for modules that have no ref specified in the manifest
15   GST_UPSTREAM_BRANCH: 'master'
16   ORC_UPSTREAM_BRANCH: 'master'
17
18   ###
19   # IMPORTANT
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.
23   ###
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'
30
31   GST_UPSTREAM_REPO: 'gstreamer/gst-ci'
32
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'
39
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"
47
48   WINDOWS_IMAGE: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/windows:v12-master'
49
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'
53
54   GIT_STRATEGY: none
55   MESON_BUILDTYPE_ARGS: --default-library=both
56   DEFAULT_MESON_ARGS: >
57     -Dlibnice:tests=disabled
58     -Dlibnice:examples=disabled
59     -Dopenh264:tests=disabled
60     -Dpygobject:tests=false
61     -Dpython=enabled
62     -Dlibav=enabled
63     -Dugly=enabled
64     -Dbad=enabled
65     -Ddevtools=enabled
66     -Dges=enabled
67     -Drtsp_server=enabled
68     -Dvaapi=enabled
69     -Dsharp=disabled
70
71   MESON_GST_WERROR: >
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
82     -Dgst-omx:werror=true
83     -Dgst-devtools:werror=true
84     -Dgst-python:werror=true
85     -Dgstreamer-vaapi:werror=true
86     -Dgstreamer-sharp:werror=true
87
88   DEFAULT_CERBERO_ARGS: >
89     --variants werror
90     --timestamps
91
92 #
93 # Global CI policy
94 #
95 # This can be used to configure global behaviour our our jobs.
96 #
97 default:
98   retry:
99     max: 2
100     when:
101       - 'runner_system_failure'
102       - 'stuck_or_timeout_failure'
103       - 'scheduler_failure'
104       - 'api_failure'
105   interruptible: true
106
107
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
110 #
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
115   set -x
116
117   if [[ -z "$GST_FORCE_REBUILD" ]]
118   then
119     # disable exit on failure
120     set +e
121
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
125
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
128
129     # check if our image is already in the upstream registry
130     if [[ -z "$GST_UPSTREAM_REPO" ]]
131     then
132       echo "WARNING! Variable \$GST_UPSTREAM_REPO is undefined, cannot check for images"
133     else
134       skopeo inspect docker://$GST_UPSTREAM_IMAGE | jq '[.Digest, .Layers]' > upstream_sha
135     fi
136
137     # reenable exit on failure
138     set -e
139
140     # if the upstream repo has an image, ensure we use the same
141     if [ -s upstream_sha ]
142     then
143
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
147
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
157
158       exit 0
159     fi
160
161     set +x
162
163     # if the local ci fork repo has an image, ensure we use the same
164     if [ -s local_gst_ci_sha ]
165     then
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
169
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
179
180       exit 0
181     fi
182
183     # if we have a local image but none in the upstream repo, use our
184     if [ -s local_sha ]
185     then
186       echo "Using $LOCAL_IMAGE"
187       exit 0
188     fi
189   fi
190
191
192 # Build docker images from Dockerfiles
193 #
194 # This is copied/adapted from citemplates/templates/fedora.yml
195 # https://gitlab.freedesktop.org/freedesktop/ci-templates/-/blob/96b621fe9f57ec2464f8d1a0940446afbf6c8f59/templates/fedora.yml
196 #
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.
200 #
201 # All the documentation from citemplates should be applicable here, so please refer there
202 .base:
203   image: "$CI_REGISTRY/freedesktop/ci-templates/buildah:2020-07-20.1"
204   variables:
205     STORAGE_DRIVER: 'vfs'
206     BUILDAH_FORMAT: 'docker'
207     BUILDAH_ISOLATION: 'chroot'
208
209     GIT_STRATEGY: fetch
210   script:
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"
214
215     # check if the docker registry is enabled, else the variable will be missing
216     - |
217       if [[ -z "$CI_REGISTRY_IMAGE" ]]
218       then
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"
222         exit 1
223       fi
224
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
228
229     - *check_image_exists
230
231     # This part of the job should only ever be possible to be reach in a gst-ci fork
232     - |
233       if [[ "$CI_PROJECT_NAME" != 'gst-ci' ]]
234       then
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"
237         exit 1
238       fi
239
240     - echo "Building image $LOCAL_IMAGE"
241
242     - >
243       buildah bud
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"
253       -f $DOCKERFILE
254       -t $LOCAL_IMAGE
255       $CONTEXT_DIR
256
257     - buildah login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
258
259     # Sanity check
260     - |
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"
264           echo $LOCAL_IMAGE
265           echo $GST_UPSTREAM_IMAGE
266           exit 1
267         fi
268       fi
269
270     -  buildah push $LOCAL_IMAGE
271
272 fedora amd64 docker:
273   stage: "build docker"
274   variables:
275     REPO_SUFFIX: "$FEDORA_AMD64_SUFFIX"
276     TAG: "$FEDORA_TAG-$GST_UPSTREAM_BRANCH"
277
278     CONTEXT_DIR: "./docker/fedora/"
279     DOCKERFILE: "docker/fedora/Dockerfile"
280   extends: .base
281
282 cerbero fedora amd64 docker:
283   stage: "build docker"
284   variables:
285     REPO_SUFFIX: "$CERBERO_AMD64_SUFFIX"
286     TAG: "$CERBERO_TAG-$GST_UPSTREAM_BRANCH"
287
288     CONTEXT_DIR: "docker/cerbero/"
289     DOCKERFILE: "docker/cerbero/Dockerfile-fedora"
290   extends: .base
291
292 android docker:
293   stage: "build docker"
294   variables:
295     REPO_SUFFIX: "$ANDROID_AMD64_SUFFIX"
296     TAG: "$ANDROID_TAG-$GST_UPSTREAM_BRANCH"
297
298     CONTEXT_DIR: "docker/android/"
299     DOCKERFILE: "docker/android/Dockerfile"
300   extends: .base
301
302 alpine amd64 manifest builder docker:
303   stage: "build docker"
304   variables:
305     REPO_SUFFIX: "$MANIFEST_AMD64_SUFFIX"
306     TAG: '$MANIFEST_TAG-$GST_UPSTREAM_BRANCH'
307
308     CONTEXT_DIR: "docker/build_manifest/"
309     DOCKERFILE: "docker/build_manifest/Dockerfile"
310   extends: .base
311
312 gst-indent amd64 docker:
313   stage: "build docker"
314   variables:
315     REPO_SUFFIX: "$INDENT_AMD64_SUFFIX"
316     TAG: "$INDENT_TAG-$GST_UPSTREAM_BRANCH"
317
318     CONTEXT_DIR: "docker/indent/"
319     DOCKERFILE: "docker/indent/Dockerfile"
320   extends: .base
321
322 #
323 # Job to create the manifest.xml to used for our builds
324 #
325 manifest:
326   image: $MANIFEST_IMAGE
327   rules:
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"'
332
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"'
339       when: 'manual'
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"'
343       when: 'manual'
344
345   stage: 'preparation'
346   script:
347     - cd /gst-ci
348     - gitlab/build_manifest.py --self-update
349     - gitlab/build_manifest.py ${CI_PROJECT_DIR}/manifest.xml
350     - cat ${CI_PROJECT_DIR}/manifest.xml
351   artifacts:
352     expire_in: "7 days"
353     paths:
354       - "manifest.xml"
355
356 #
357 # gst-indent!!
358 #
359 gst indent:
360   image: $INDENT_IMAGE
361   stage: 'preparation'
362   variables:
363     GIT_STRATEGY: 'fetch'
364   rules:
365     - if: '$CI_PROJECT_NAME !~ /^(gstreamer-sharp|gst-integration-testsuites|cerbero|gst-docs)$/'
366   script:
367     # man indent. grep RETURN VALUE, grab a beer on my behalf...
368     - indent --version || true
369     - |
370       filter_cmd=("cat")
371       if test -f ".indentignore"; then
372           filter_args=()
373           while read -r line; do
374               if test -n "$line"; then
375                   filter_args+=("-e" "$line")
376               fi
377           done < ".indentignore"
378           if [[ ${#filter_args[@]} -gt 0 ]]; then
379               filter_cmd=("grep" "-v" "${filter_args[@]}")
380           fi
381       fi
382       find . -name '*.c' | "${filter_cmd[@]}" | xargs -d '\n' gst-indent
383     - |
384       if git diff --quiet; then
385           echo "Code is properly formatted"
386       else
387           git diff --color=always
388           echo 'style diverges, please run gst-indent first'
389           exit 1
390       fi
391
392 #
393 # gst-build setup templates
394 #
395 .gst_build_template: &gst_build
396   - echo $MESON_ARGS
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
403
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
406   - cd 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
411   - ninja -C build/
412   - ccache --show-stats
413
414 .gst_build_ccache_vars:
415   variables:
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'
423
424 .simple_fedora_build: &simple_build >-
425   ${DEFAULT_MESON_ARGS}
426   -Dsharp=enabled
427   -Domx=enabled
428   -Dgst-omx:target=generic
429   -Ddoc=disabled
430   -Drs=disabled
431   ${MESON_BUILDTYPE_ARGS}
432   ${MESON_GST_WERROR}
433
434 .build:
435   stage: 'build'
436   extends:
437     - '.gst_build_ccache_vars'
438   needs:
439     - "manifest"
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
442   timeout: '45min'
443   variables:
444     MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
445   rules:
446     - if: '$CI_PROJECT_NAME != "cerbero"'
447   script:
448     *gst_build
449   after_script:
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
453     - rm -rf gst-build
454   artifacts:
455     expire_in: "7 days"
456     when: "always"
457     paths:
458       - 'meson-logs/'
459       - 'manifest.xml'
460
461 .build fedora x86_64:
462   extends: '.build'
463   image: $FEDORA_IMAGE
464   variables:
465     MESON_ARGS: *simple_build
466   rules:
467     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-omx|gst-plugins-rs)$/'
468
469 build nodebug fedora x86_64:
470   extends: '.build'
471   image: $FEDORA_IMAGE
472   variables:
473     MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
474   rules:
475     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
476
477 build static fedora x86_64:
478   extends: '.build fedora x86_64'
479   variables:
480     MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
481   rules:
482     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
483
484 build static nodebug fedora x86_64:
485   extends: 'build nodebug fedora x86_64'
486   variables:
487     MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
488   rules:
489     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
490
491 build clang fedora x86_64:
492   extends: '.build fedora x86_64'
493   variables:
494     CC: 'ccache clang'
495     CXX: 'ccache clang++'
496   rules:
497     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
498
499 .test:
500   stage: 'test'
501   extends:
502     - '.gst_build_ccache_vars'
503   needs:
504     - "manifest"
505   variables:
506     MESON_ARGS: *simple_build
507
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"
512     TIMEOUT_FACTOR: "2"
513     CARGO_HOME: "/cache/gstreamer/cargo"
514   rules:
515     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-examples|gst-docs)$/'
516   script:
517     - *gst_build
518
519     - echo "-> Running ${TEST_SUITE}"
520     - >
521       ./gst-uninstalled.py
522       gst-validate-launcher ${TEST_SUITE}
523       --dump-on-failure
524       --mute
525       --shuffle
526       --no-display
527       --meson-no-rebuild
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}
533   after_script:
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
537     - rm -rf gst-build
538   artifacts:
539     expire_in: '14 days'
540     when: always
541     paths:
542       - 'meson-logs/'
543       - 'validate-logs'
544       - 'manifest.xml'
545     reports:
546       junit:
547         - "validate-logs/*.xml"
548
549 .test fedora x86_64:
550   image: $FEDORA_IMAGE
551   extends: '.test'
552   tags: ['gstreamer']
553
554 check fedora:
555   extends: '.test fedora x86_64'
556   variables:
557     TEST_SUITE: "check.gst*"
558   rules:
559     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
560
561 integration testsuites fedora:
562   extends: '.test fedora x86_64'
563   parallel: 4
564   variables:
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"
567   rules:
568     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-examples|gst-omx|gstreamer-sharp|gst-plugins-rs)$/'
569
570 gstreamer-full:
571   extends: 'build static fedora x86_64'
572   stage: integrate
573   variables:
574     MESON_ARGS: >
575       --default-library=static
576       -Dauto_features=disabled
577       -Dgst-plugins-good:alpha=enabled
578       $MESON_GST_WERROR
579   rules:
580     - if: '$CI_PROJECT_NAME =~ /^(gst-build|gst-ci)$/'
581
582   after_script:
583   - cd gst-build/
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
588   - meson _build
589   - ninja -C _build
590   - meson test -C _build -v
591   artifacts:
592     expire_in: "7 days"
593     when: "always"
594     paths:
595       - 'gst-build/build/meson-logs/'
596       - 'gst-build/build/gstinitstaticplugins.c'
597
598 # Valgrind
599 .valgrind fedora x86_64:
600   extends: '.test fedora x86_64'
601   stage: 'test'
602   variables:
603     EXTRA_VALIDATE_ARGS: "--valgrind"
604
605 valgrind core:
606   extends: '.valgrind fedora x86_64'
607   variables:
608     TEST_SUITE: "check.gstreamer\\..*"
609   rules:
610     - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-ci|gst-devtools)$/'
611
612 valgrind base:
613   extends: '.valgrind fedora x86_64'
614   variables:
615     TEST_SUITE: "check.gst-plugins-base\\..*"
616   rules:
617     - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-ci|gst-devtools)$/'
618
619 valgrind good:
620   extends: '.valgrind fedora x86_64'
621   variables:
622     TEST_SUITE: "check.gst-plugins-good\\..*"
623     # take longer time due to splitmux unit test
624     TIMEOUT_FACTOR: "4"
625   rules:
626     - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-ci|gst-devtools)$/'
627
628 valgrind ugly:
629   extends: '.valgrind fedora x86_64'
630   variables:
631     TEST_SUITE: "check.gst-plugins-ugly\\..*"
632   rules:
633     - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-ugly|gst-ci|gst-devtools)$/'
634
635 valgrind bad:
636   extends: '.valgrind fedora x86_64'
637   variables:
638     TEST_SUITE: "check.gst-plugins-bad\\..*"
639   rules:
640     - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-plugins-bad|gst-ci|gst-devtools)$/'
641
642 valgrind ges:
643   extends: '.valgrind fedora x86_64'
644   variables:
645     TEST_SUITE: "check.gst-editing-services\\..*"
646   rules:
647     - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-editing-services|gst-ci|gst-devtools)$/'
648
649 # Template for Cerbero GStreamer Build
650 #
651 # Parameters:
652 # CONFIG: The name of the configuration file to use
653 # ARCH: The cerbero <os>_<cpu> (used in cache key)
654 #
655 .cerbero:
656   stage: "build"
657   image: $CERBERO_IMAGE
658   rules:
659     - if: '$CI_PROJECT_NAME == "cerbero"'
660   needs:
661     - "manifest"
662   # Ensure that the runners it will be executed on
663   # will have plenty of space for the cache
664   tags: ['gstreamer']
665   timeout: '3h'
666   variables:
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"
673
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
681     HAVE_CCACHE: "yes"
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/"
686   before_script:
687     - curl -L -o cerbero_script.sh "${CERBERO_SCRIPT_URL}"
688     - chmod +x cerbero_script.sh
689     - ./cerbero_script.sh cerbero_before_script
690   script:
691     - ./cerbero_script.sh cerbero_script
692   cache:
693     key: "${CI_JOB_NAME}"
694     paths:
695       - "${CERBERO_SOURCES}"
696   artifacts:
697     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
698     expire_in: '5 days'
699     when: 'always'
700     paths:
701       - "manifest.xml"
702       - "${CERBERO_HOME}/logs"
703       - "*.tar.*"
704
705 .build windows:
706   image: $WINDOWS_IMAGE
707   stage: 'build'
708   needs:
709     - 'manifest'
710   tags:
711     - 'docker'
712     - 'windows'
713     - '1809'
714   timeout: '45min'
715   variables:
716     MESON_ARGS: >
717       ${DEFAULT_MESON_ARGS}
718       -Dpython=disabled
719       -Dlibav=disabled
720       -Dvaapi=disabled
721       -Ddevtools=disabled
722   rules:
723     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs|gstreamer-vaapi)$/'
724   script:
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 }
730
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"
734
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
738
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 &&
750         ninja -C build"
751   # XXX: Re-enable when uploading stops timing out
752   #artifacts:
753   #  expire_in: "7 days"
754   #  when: "always"
755   #  paths:
756   #    - 'gst-build/build/meson-logs/'
757
758 build vs2017 amd64:
759   extends: '.build windows'
760   variables:
761     ARCH: 'amd64'
762
763 build vs2017 x86:
764   extends: '.build windows'
765   variables:
766     ARCH: 'x86'
767
768 build msys2 :
769   extends: '.build windows'
770   timeout: '60min'
771   rules:
772     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs|gstreamer-vaapi)$/'
773       allow_failure: true
774       when: 'manual'
775   script:
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 }
781
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"
785
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"
799
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
803
804     - cp -r C:\subprojects\* subprojects\
805
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 &&
815         ninja -C build"
816
817
818 # Template for Cerbero GStreamer Deps
819 #
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.
823 #
824 # Parameters:
825 # CONFIG: The name of the configuration file to use
826 # ARCH: The cerbero <os>_<cpu> (used in cache key)
827 #
828 # Produce an artifact with the dist/ and .cache along
829 # with the associated build-tools.
830 .cerbero deps:
831   extends: .cerbero
832   rules:
833     - if: '$CI_PROJECT_NAME == "cerbero"'
834   script:
835     - ./cerbero_script.sh cerbero_deps_script
836
837 #
838 # Cerbero Linux X86_64 build
839 #
840 cerbero deps fedora x86_64:
841   extends: '.cerbero deps'
842   variables:
843     CONFIG: "linux.config"
844     ARCH: "linux_x86_64"
845
846 build cerbero fedora x86_64:
847   extends: '.cerbero'
848   rules:
849     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'
850   variables:
851     CONFIG: "linux.config"
852
853 #
854 # Cerbero Android Universal build
855 #
856 .cerbero cross-android universal:
857   variables:
858     CONFIG: "cross-android-universal.cbc"
859     ARCH: "android_universal"
860   artifacts:
861     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
862     expire_in: '5 days'
863     when: 'always'
864     paths:
865       - "manifest.xml"
866       - "${CERBERO_HOME}/logs"
867       - "*[0-9].tar.*"
868
869 cerbero deps cross-android universal:
870   extends:
871     - '.cerbero deps'
872     - '.cerbero cross-android universal'
873
874 build cerbero cross-android universal:
875   extends:
876     - '.cerbero'
877     - '.cerbero cross-android universal'
878   rules:
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)$/'
881
882 #
883 # Cerbero Cross Windows builds
884 #
885 cerbero deps cross-windows x86:
886   extends: '.cerbero deps'
887   variables:
888     CONFIG: "cross-win32.cbc"
889     ARCH: "mingw_x86"
890
891 build cerbero cross win32:
892   extends: '.cerbero'
893   rules:
894     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'
895   variables:
896     CONFIG: "cross-win32.cbc"
897     CERBERO_RUN_WRAPPER: "wine"
898     CERBERO_RUN_SUFFIX: ".exe"
899
900
901 cerbero deps cross-windows x86_64:
902   extends: '.cerbero deps'
903   variables:
904     CONFIG: "cross-win64.cbc"
905     ARCH: "mingw_x86_64"
906
907 build cerbero cross win64:
908   extends: '.cerbero'
909   rules:
910     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'
911   variables:
912     CONFIG: "cross-win64.cbc"
913     CERBERO_RUN_WRAPPER: "wine"
914     CERBERO_RUN_SUFFIX: ".exe"
915
916 #
917 # Build an Android App using the android binaries
918 #
919 .cross-android universal examples:
920   image: $ANDROID_IMAGE
921   stage: 'integrate'
922   variables:
923     EXAMPLES_HOME: ${CI_PROJECT_DIR}/examples
924     GSTREAMER_ROOT_ANDROID: ${CI_PROJECT_DIR}/examples/cerbero-android-universal
925   script:
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
932
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.*
937
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/
942
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/
947
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/
952   after_script:
953     - rm -rf ${GSTREAMER_ROOT_ANDROID}
954     - rm -rf ${EXAMPLES_HOME}/gst-examples ${EXAMPLES_HOME}/gst-docs
955   artifacts:
956     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
957     expire_in: '5 days'
958     when: 'always'
959     paths:
960       - "manifest.xml"
961       - "${EXAMPLES_HOME}/outputs"
962
963 cross-android universal examples:
964   extends: ".cross-android universal examples"
965   rules:
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)$/'
968   needs:
969     - "build cerbero cross-android universal"
970
971 cerbero cross-android universal examples:
972   extends: ".cross-android universal examples"
973   rules:
974     - if: '$CI_PROJECT_NAME == "cerbero"'
975   needs:
976     - "cerbero deps cross-android universal"
977
978 #
979 # Cerbero macOS X86_64 build
980 #
981 .cerbero macos x86_64:
982   variables:
983     ARCH: "darwin_x86_64"
984     CONFIG: "osx-x86-64.cbc"
985     CERBERO_PACKAGE_ARGS: ""
986     HAVE_CCACHE: ""
987     CERBERO_OVERRIDDEN_DIST_DIR: "/Library/Frameworks/GStreamer.framework/Versions/1.0"
988     CERBERO_HOST_DIR: "/Users/gst-ci/cerbero/"
989   tags:
990     - gst-macos-10.15
991   artifacts:
992     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
993     expire_in: '5 days'
994     when: 'always'
995     paths:
996       - "manifest.xml"
997       - "${CERBERO_HOME}/logs"
998       - "gstreamer-1.0-1.*.pkg"
999       - "gstreamer-1.0-devel-1.*.pkg"
1000
1001 cerbero deps macos x86_64:
1002   extends:
1003     - '.cerbero deps'
1004     - '.cerbero macos x86_64'
1005
1006 build cerbero macos x86_64:
1007   extends:
1008     - '.cerbero'
1009     - '.cerbero macos x86_64'
1010   rules:
1011     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gst-sharp|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
1012
1013 #
1014 # Cerbero iOS build
1015 #
1016 .cerbero cross-ios universal:
1017   variables:
1018     ARCH: "ios_universal"
1019     CONFIG: "cross-ios-universal.cbc"
1020     CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS} -v nowerror"
1021     CERBERO_PACKAGE_ARGS: ""
1022     HAVE_CCACHE: ""
1023     CERBERO_HOST_DIR: "/Users/gst-ci/cerbero/"
1024   tags:
1025     - gst-ios-13.2
1026   artifacts:
1027     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
1028     expire_in: '5 days'
1029     when: 'always'
1030     paths:
1031       - "manifest.xml"
1032       - "${CERBERO_HOME}/logs"
1033       - "gstreamer-1.0-*-ios-universal.pkg"
1034
1035 cerbero deps cross-ios universal:
1036   extends:
1037     - '.cerbero deps'
1038     - '.cerbero cross-ios universal'
1039
1040 build cerbero cross-ios universal:
1041   extends:
1042     - '.cerbero'
1043     - '.cerbero cross-ios universal'
1044   rules:
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)$/'
1047
1048 documentation:
1049   image: $FEDORA_DOCS_IMAGE
1050   extends:
1051     - '.gst_build_ccache_vars'
1052   rules:
1053     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-integration-testsuites|gst-plugins-rs|gst-python)$/'
1054   needs:
1055     - "manifest"
1056   stage: integrate
1057   variables:
1058     MESON_ARGS: *simple_build
1059     MESON_BUILDTYPE_ARGS: "-Ddoc=enabled"
1060     CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
1061   script:
1062   - pip3 install --upgrade git+https://github.com/hotdoc/hotdoc@28ad9aa59daa49d6b3fd1bc6b144df52af39475b
1063
1064   # FIXME: remove this once the docs image is updated
1065   - rm -rf /gst-build/subprojects/pygobject/
1066
1067   - *gst_build
1068   - ./gst-uninstalled.py ninja -C build/ plugins_doc_caches
1069   - |
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',]
1074
1075     diffsdir = '../plugins-cache-diffs'
1076     os.makedirs(diffsdir, exist_ok=True)
1077     res = 0
1078     for subproject in subprojects:
1079         cwd = os.path.join('subprojects', subproject)
1080         try:
1081             subprocess.check_call(['git', 'diff', '--quiet'], cwd=cwd)
1082         except subprocess.CalledProcessError:
1083             diffname = os.path.join(diffsdir, '%s_cache.diff' % subproject)
1084             res += 1
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('../', '')))
1089     if res != 0:
1090         print('(note that it might take a few minutes for artefacts to be available on the server)\n')
1091         sys.exit(res)"
1092
1093   - ./gst-uninstalled.py hotdoc run --conf-file=build/subprojects/gst-docs/GStreamer-doc.json --fatal-warnings
1094   - cd -
1095   - mv gst-build/build/subprojects/gst-docs/GStreamer-doc/html documentation/
1096
1097   artifacts:
1098     when: always
1099     paths:
1100     - documentation/
1101     - plugins-cache-diffs/
1102
1103 #
1104 # Build an iOS App using the iOS binaries
1105 #
1106 .cross-ios universal examples:
1107   stage: 'integrate'
1108   variables:
1109     EXAMPLES_HOME: ${CI_PROJECT_DIR}/examples
1110     # disable codesigning so we don't need developer identities on the CI
1111     # machines
1112     XCODE_BUILD_ARGS: >
1113       CODE_SIGNING_REQUIRED="NO"
1114       CODE_SIGN_IDENTITY=""
1115       CODE_SIGNING_ALLOWED="NO"
1116       CODE_SIGN_ENTITLEMENTS=""
1117   script:
1118     # install the binaries
1119     - installer -pkg gstreamer-1.0-devel-*-ios-universal.pkg -target CurrentUserHomeDirectory -verbose
1120
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
1126
1127     # dump some useful information
1128     - xcodebuild -version
1129     - xcodebuild -showsdks
1130
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}
1134
1135     # gst-examples
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}
1138   after_script:
1139     - rm -rf ${EXAMPLES_HOME}/gst-examples ${EXAMPLES_HOME}/gst-docs
1140   tags:
1141     - gst-ios-13.2
1142
1143 cross-ios universal examples:
1144   extends: ".cross-ios universal examples"
1145   rules:
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)$/'
1148   needs:
1149     - "build cerbero cross-ios universal"
1150
1151 cerbero cross-ios universal examples:
1152   extends: ".cross-ios universal examples"
1153   rules:
1154     - if: '$CI_PROJECT_NAME == "cerbero"'
1155   needs:
1156     - "cerbero deps cross-ios universal"
1157
1158 build gst-omx zynq fedora x86_64:
1159   extends: '.build fedora x86_64'
1160   variables:
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"
1162   rules:
1163     - if: '$CI_PROJECT_NAME =~ /^(gst-omx|gst-ci)$/'
1164   before_script:
1165     - git clone https://github.com/Xilinx/vcu-omx-il.git --branch=release-2020.1 ${CI_PROJECT_DIR}/vcu-omx-il
1166
1167 build gst-omx tizonia fedora x86_64:
1168   extends: '.build fedora x86_64'
1169   variables:
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/
1172   rules:
1173     - if: '$CI_PROJECT_NAME =~ /^(gst-omx|gst-ci)$/'
1174   before_script:
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
1178     - ninja -C build
1179     - ninja -C build install
1180     - cd ..
1181
1182 #
1183 # Cerbero Native Windows builds
1184 #
1185 .cerbero windows native:
1186   needs: ['manifest']
1187   image: $WINDOWS_IMAGE
1188   tags:
1189     - 'docker'
1190     - 'windows'
1191     - 'gstreamer-windows'
1192     - '1809'
1193   variables:
1194     CONFIG: 'win64.cbc'
1195     ARCH: 'msvc_x86_64'
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"
1202     HAVE_CCACHE: ""
1203   # FIXME: for some reason the runner is hanging when trying to upload artifacts
1204   artifacts:
1205     paths: []
1206   before_script:
1207     - $env:CI_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\', '/')
1208     - $env:CERBERO_SCRIPTS_PATH = "$env:CI_PROJECT_DIR/cerbero_setup.sh"
1209
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"
1212
1213 cerbero deps msvc x86_64:
1214   extends: ['.cerbero deps', '.cerbero windows native']
1215   script:
1216     - C:\MinGW\msys\1.0\bin\bash.exe --login -c "cd $env:CI_PROJECT_DIR && $env:CERBERO_SCRIPTS_PATH cerbero_deps_script"
1217
1218 build cerbero msvc x86_64:
1219   extends: ['.cerbero', '.cerbero windows native']
1220   script:
1221     - C:\MinGW\msys\1.0\bin\bash.exe --login -c "cd $env:CI_PROJECT_DIR && $env:CERBERO_SCRIPTS_PATH cerbero_script"
1222   rules:
1223     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'