f30bf5534e15a75aa31c45c461a451d750e64153
[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-07-03.1'
25   CERBERO_TAG: '2020-06-25.0'
26   ANDROID_TAG: '2020-06-25.0'
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:v11-master'
49
50   GIT_STRATEGY: none
51   MESON_BUILDTYPE_ARGS: --default-library=both
52   DEFAULT_MESON_ARGS: >
53     -Dlibnice:tests=disabled
54     -Dlibnice:examples=disabled
55     -Dopenh264:tests=disabled
56     -Dpygobject:tests=false
57     -Dpython=enabled
58     -Dlibav=enabled
59     -Dugly=enabled
60     -Dbad=enabled
61     -Ddevtools=enabled
62     -Dges=enabled
63     -Drtsp_server=enabled
64     -Dvaapi=enabled
65     -Dsharp=disabled
66
67   MESON_GST_WERROR: >
68     -Dgstreamer:werror=true
69     -Dgst-plugins-base:werror=true
70     -Dgst-plugins-good:werror=true
71     -Dgst-plugins-ugly:werror=true
72     -Dgst-plugins-bad:werror=true
73     -Dgst-rtsp-server:werror=true
74     -Dgst-libav:werror=true
75     -Dgst-examples:werror=true
76     -Dgst-editing-services:werror=true
77     -Dgst-docs:werror=true
78     -Dgst-omx:werror=true
79     -Dgst-devtools:werror=true
80     -Dgst-python:werror=true
81     -Dgstreamer-vaapi:werror=true
82     -Dgstreamer-sharp:werror=true
83
84   DEFAULT_CERBERO_ARGS: >
85     --variants werror
86     --timestamps
87
88 #
89 # Global CI policy
90 #
91 # This can be used to configure global behaviour our our jobs.
92 #
93 default:
94   retry:
95     max: 2
96     when:
97       - 'runner_system_failure'
98       - 'stuck_or_timeout_failure'
99       - 'scheduler_failure'
100       - 'api_failure'
101   interruptible: true
102
103
104 # Script to check if a docker image exists in the upstream registry
105 # and if so copy it to the forked registry so we can use it
106 #
107 # This is copied/adapted from citemplates/templates/fedora.yml
108 # https://gitlab.freedesktop.org/freedesktop/ci-templates/-/blob/96b621fe9f57ec2464f8d1a0940446afbf6c8f59/templates/fedora.yml
109 .check_image: &check_image_exists |
110   # if-not-exists steps
111   set -x
112
113   if [[ -z "$GST_FORCE_REBUILD" ]]
114   then
115     # disable exit on failure
116     set +e
117
118     # check if our image is already in the current registry
119     # we store the sha of the digest and the layers
120     skopeo inspect docker://$LOCAL_IMAGE | jq '[.Digest, .Layers]' > local_sha
121
122     # check if our image is already in our gst-ci registry fork
123     skopeo inspect docker://$LOCAL_GST_CI_IMAGE | jq '[.Digest, .Layers]' > local_gst_ci_sha
124
125     # check if our image is already in the upstream registry
126     if [[ -z "$GST_UPSTREAM_REPO" ]]
127     then
128       echo "WARNING! Variable \$GST_UPSTREAM_REPO is undefined, cannot check for images"
129     else
130       skopeo inspect docker://$GST_UPSTREAM_IMAGE | jq '[.Digest, .Layers]' > upstream_sha
131     fi
132
133     # reenable exit on failure
134     set -e
135
136     # if the upstream repo has an image, ensure we use the same
137     if [ -s upstream_sha ]
138     then
139
140       echo "Checking if $LOCAL_IMAGE is up to date"
141       # ensure we use the same image from upstream
142       diff upstream_sha local_sha && exit 0 || true
143
144       echo "Copying image from gstreamer/gst-ci to local registry"
145       # copy the original image into the current project registry namespace
146       # we do 2 attempts with skopeo copy at most
147       skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
148                   docker://$GST_UPSTREAM_IMAGE \
149                   docker://$LOCAL_IMAGE || \
150       skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
151                   docker://$GST_UPSTREAM_IMAGE \
152                   docker://$LOCAL_IMAGE
153
154       exit 0
155     fi
156
157     set +x
158
159     # if the local ci fork repo has an image, ensure we use the same
160     if [ -s local_gst_ci_sha ]
161     then
162       echo "Checking if $LOCAL_GST_CI_IMAGE is up to date"
163       # ensure we use the same image from upstream
164       diff local_gst_ci_sha local_sha && exit 0 || true
165
166       echo "Copying image from $CI_PROJECT_NAMESPACE/gst-ci to local registry"
167       # copy the original image into the current project registry namespace
168       # we do 2 attempts with skopeo copy at most
169       skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
170                   docker://$LOCAL_GST_CI_IMAGE \
171                   docker://$LOCAL_IMAGE || \
172       skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
173                   docker://$LOCAL_GST_CI_IMAGE \
174                   docker://$LOCAL_IMAGE
175
176       exit 0
177     fi
178
179     # if we have a local image but none in the upstream repo, use our
180     if [ -s local_sha ]
181     then
182       echo "Using $LOCAL_IMAGE"
183       exit 0
184     fi
185   fi
186
187
188 # Build docker images from Dockerfiles
189 #
190 # This is copied/adapted from citemplates/templates/fedora.yml
191 # https://gitlab.freedesktop.org/freedesktop/ci-templates/-/blob/96b621fe9f57ec2464f8d1a0940446afbf6c8f59/templates/fedora.yml
192 #
193 # CITemplates builds uses buildah run/commit workflow to build the images which doesn't
194 # fit us atm and our images need further adjustment to make use of it. Porting to
195 # ci-templates is the next step though.
196 #
197 # All the documentation from citemplates should be applicable here, so please refer there
198 .base:
199   image: "$CI_REGISTRY/freedesktop/ci-templates/buildah:2020-03-24"
200   variables:
201     STORAGE_DRIVER: 'vfs'
202     BUILDAH_FORMAT: 'docker'
203     BUILDAH_ISOLATION: 'chroot'
204
205     GIT_STRATEGY: fetch
206   script:
207     - export LOCAL_IMAGE="$CI_REGISTRY_IMAGE/$REPO_SUFFIX:$TAG"
208     - export LOCAL_GST_CI_IMAGE="$CI_REGISTRY/$CI_PROJECT_NAMESPACE/gst-ci/$REPO_SUFFIX:$TAG"
209     - export GST_UPSTREAM_IMAGE="$CI_REGISTRY/$GST_UPSTREAM_REPO/$REPO_SUFFIX:$TAG"
210
211     # check if the docker registry is enabled, else the variable will be missing
212     - |
213       if [[ -z "$CI_REGISTRY_IMAGE" ]]
214       then
215         echo "ERROR! Looks like your repository/fork has disabled Docker Registries."
216         echo "Pleae enable them by following the documentation from here:"
217         echo "https://docs.gitlab.com/ee/user/packages/container_registry/#enable-the-container-registry-for-your-project"
218         exit 1
219       fi
220
221     # Newer versions of podman/buildah try to set overlayfs mount options when
222     # using the vfs driver, and this causes errors.
223     - sed -i '/^mountopt =.*/d' /etc/containers/storage.conf
224
225     - *check_image_exists
226
227     # This part of the job should only ever be possible to be reach in a gst-ci fork
228     - |
229       if [[ "$CI_PROJECT_NAME" != 'gst-ci' ]]
230       then
231         echo "ERROR! Something is wrong!"
232         echo "This part of the job is supposed to be executed only in gst-ci forks, and its probably going to fail else"
233         exit 1
234       fi
235
236     - echo "Building image $LOCAL_IMAGE"
237
238     - >
239       buildah bud
240       --build-arg DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH
241       --label ci.job_id=$CI_JOB_ID
242       --label pipeline.url=$CI_PIPELINE_URL
243       --label git.ref_name=$CI_COMMIT_REF_NAME
244       --label git.sha=$CI_COMMIT_SHA
245       --label gitlab.project_path=$CI_PROJECT_PATH
246       --label gitlab.project_url=$CI_PROJECT_URL
247       --label fdo.upstream-repo=$GST_UPSTREAM_REPO
248       --label fdo.expires-after="3w"
249       -f $DOCKERFILE
250       -t $LOCAL_IMAGE
251       $CONTEXT_DIR
252
253     - buildah login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
254
255     # Sanity check
256     - |
257       if [ "$CI_PROJECT_PATH" = "gstreamer/gst-ci" ]; then
258         if [ "$LOCAL_IMAGE" != "$GST_UPSTREAM_IMAGE" ]; then
259           echo "ERROR!!! AAAAA! THE IMAGE URI DOES NOT MATCH THE EXPECTED UPSTREAM ONE"
260           echo $LOCAL_IMAGE
261           echo $GST_UPSTREAM_IMAGE
262           exit 1
263         fi
264       fi
265
266     -  buildah push $LOCAL_IMAGE
267
268 fedora amd64 docker:
269   stage: "build docker"
270   variables:
271     REPO_SUFFIX: "$FEDORA_AMD64_SUFFIX"
272     TAG: "$FEDORA_TAG-$GST_UPSTREAM_BRANCH"
273
274     CONTEXT_DIR: "./docker/fedora/"
275     DOCKERFILE: "docker/fedora/Dockerfile"
276   extends: .base
277
278 cerbero fedora amd64 docker:
279   stage: "build docker"
280   variables:
281     REPO_SUFFIX: "$CERBERO_AMD64_SUFFIX"
282     TAG: "$CERBERO_TAG-$GST_UPSTREAM_BRANCH"
283
284     CONTEXT_DIR: "docker/cerbero/"
285     DOCKERFILE: "docker/cerbero/Dockerfile-fedora"
286   extends: .base
287
288 android docker:
289   stage: "build docker"
290   variables:
291     REPO_SUFFIX: "$ANDROID_AMD64_SUFFIX"
292     TAG: "$ANDROID_TAG-$GST_UPSTREAM_BRANCH"
293
294     CONTEXT_DIR: "docker/android/"
295     DOCKERFILE: "docker/android/Dockerfile"
296   extends: .base
297
298 alpine amd64 manifest builder docker:
299   stage: "build docker"
300   variables:
301     REPO_SUFFIX: "$MANIFEST_AMD64_SUFFIX"
302     TAG: '$MANIFEST_TAG-$GST_UPSTREAM_BRANCH'
303
304     CONTEXT_DIR: "docker/build_manifest/"
305     DOCKERFILE: "docker/build_manifest/Dockerfile"
306   extends: .base
307
308 gst-indent amd64 docker:
309   stage: "build docker"
310   variables:
311     REPO_SUFFIX: "$INDENT_AMD64_SUFFIX"
312     TAG: "$INDENT_TAG-$GST_UPSTREAM_BRANCH"
313
314     CONTEXT_DIR: "docker/indent/"
315     DOCKERFILE: "docker/indent/Dockerfile"
316   extends: .base
317
318 #
319 # Job to create the manifest.xml to used for our builds
320 #
321 manifest:
322   image: $MANIFEST_IMAGE
323   rules:
324     # Always have automatic pipeline for branchs in cerbero and docs
325     # cause they need to update artifacts, like the docs site or cerbero deps
326     - if: '$CI_PROJECT_PATH == "gstreamer/cerbero"'
327     - if: '$CI_PROJECT_PATH == "gstreamer/gst-docs"'
328
329     # If the user that triggered the Pipeline is the Merge bot and the branch doesn't match
330     # the upstream branch set, run the pipeline
331     - if: '$GITLAB_USER_LOGIN == "gstreamer-merge-bot" && $CI_COMMIT_BRANCH != "$GST_UPSTREAM_BRANCH"'
332     # When the user isn't the merge bot, require an explicit action to trigger the pipeline
333     # to avoid wasting CI resources
334     - if: '$GITLAB_USER_LOGIN != "gstreamer-merge-bot"'
335       when: 'manual'
336     # If this matches, it means the pipeline is running against either the main
337     # or a stable branch, so make it manual
338     - if: '$CI_COMMIT_BRANCH == "$GST_UPSTREAM_BRANCH"'
339       when: 'manual'
340
341   stage: 'preparation'
342   script:
343     - cd /gst-ci
344     - gitlab/build_manifest.py --self-update
345     - gitlab/build_manifest.py ${CI_PROJECT_DIR}/manifest.xml
346     - cat ${CI_PROJECT_DIR}/manifest.xml
347   artifacts:
348     expire_in: "7 days"
349     paths:
350       - "manifest.xml"
351
352 #
353 # gst-indent!!
354 #
355 gst indent:
356   image: $INDENT_IMAGE
357   stage: 'preparation'
358   variables:
359     GIT_STRATEGY: 'fetch'
360   rules:
361     - if: '$CI_PROJECT_NAME !~ /^(gstreamer-sharp|gst-integration-testsuites|cerbero|gst-docs)$/'
362   script:
363     # man indent. grep RETURN VALUE, grab a beer on my behalf...
364     - indent --version || true
365     - |
366       filter_cmd=("cat")
367       if test -f ".indentignore"; then
368           filter_args=()
369           while read -r line; do
370               if test -n "$line"; then
371                   filter_args+=("-e" "$line")
372               fi
373           done < ".indentignore"
374           if [[ ${#filter_args[@]} -gt 0 ]]; then
375               filter_cmd=("grep" "-v" "${filter_args[@]}")
376           fi
377       fi
378       find . -name '*.c' | "${filter_cmd[@]}" | xargs -d '\n' gst-indent
379     - |
380       if git diff --quiet; then
381           echo "Code is properly formatted"
382       else
383           git diff --color=always
384           echo 'style diverges, please run gst-indent first'
385           exit 1
386       fi
387
388 #
389 # gst-build setup templates
390 #
391 .gst_build_template: &gst_build
392   - echo $MESON_ARGS
393   # Sometimes, gitlab-runner want to reuse
394   # existing docker volumes without cleaning them up...
395   # Make sure the docker volume is clean
396   - rm -rf gst-build || true
397   - rm -rf meson-logs || true
398   - rm -rf validate-logs || true
399
400   - curl -L -o clone_manifest_ref.py "https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/clone_manifest_ref.py"
401   - python3 clone_manifest_ref.py --manifest manifest.xml --project gst-build --destination gst-build
402   - cd gst-build/
403   # only copy immediate directories. We don't want to modify .wrap files
404   - find /gst-build/subprojects/ -mindepth 1 -maxdepth 1 -type d -exec cp -r \{\} subprojects/ \;
405   - ./git-update --no-interaction --manifest="${CI_PROJECT_DIR}/manifest.xml"
406   - meson build/ $MESON_ARGS
407   - ninja -C build/
408   - ccache --show-stats
409
410 .gst_build_ccache_vars:
411   variables:
412     CCACHE_COMPILERCHECK: 'content'
413     CCACHE_COMPRESS: 'true'
414     CCACHE_BASEDIR: '/cache/gstreamer/gst-build'
415     CCACHE_DIR: '/cache/gstreamer/gst-build/ccache/'
416     # shared across everything really
417     CCACHE_MAXSIZE: '10G'
418     CARGO_HOME: '/cache/gstreamer/cargo'
419
420 .simple_fedora_build: &simple_build >-
421   ${DEFAULT_MESON_ARGS}
422   -Dsharp=enabled
423   -Domx=enabled
424   -Dgst-omx:target=generic
425   -Ddoc=disabled
426   -Drs=disabled
427   ${MESON_BUILDTYPE_ARGS}
428   ${MESON_GST_WERROR}
429
430 .build:
431   stage: 'build'
432   extends:
433     - '.gst_build_ccache_vars'
434   needs:
435     - "manifest"
436   # Taking into account the slowest shared runner + time needed to upload the binaries to artifacts
437   # Also need to take into account I/O of pulling docker images and uploading artifacts
438   timeout: '45min'
439   variables:
440     MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
441   rules:
442     - if: '$CI_PROJECT_NAME != "cerbero"'
443   script:
444     *gst_build
445   after_script:
446     - mv gst-build/build/meson-logs/ meson-logs
447     # Cleanup everything else to reduce the size
448     # of the docker volume we leave behind
449     - rm -rf gst-build
450   artifacts:
451     expire_in: "7 days"
452     when: "always"
453     paths:
454       - 'meson-logs/'
455       - 'manifest.xml'
456
457 .build fedora x86_64:
458   extends: '.build'
459   image: $FEDORA_IMAGE
460   variables:
461     MESON_ARGS: *simple_build
462   rules:
463     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-omx|gst-plugins-rs)$/'
464
465 build nodebug fedora x86_64:
466   extends: '.build'
467   image: $FEDORA_IMAGE
468   variables:
469     MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
470   rules:
471     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
472
473 build static fedora x86_64:
474   extends: '.build fedora x86_64'
475   variables:
476     MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
477   rules:
478     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
479
480 build static nodebug fedora x86_64:
481   extends: 'build nodebug fedora x86_64'
482   variables:
483     MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
484   rules:
485     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
486
487 build clang fedora x86_64:
488   extends: '.build fedora x86_64'
489   variables:
490     CC: 'ccache clang'
491     CXX: 'ccache clang++'
492   rules:
493     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
494
495 .test:
496   stage: 'test'
497   extends:
498     - '.gst_build_ccache_vars'
499   needs:
500     - "manifest"
501   variables:
502     MESON_ARGS: *simple_build
503
504     # Disable colored output to avoid weird rendering issues
505     GST_DEBUG_NO_COLOR: "true"
506     CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/validate-logs/"
507     GST_VALIDATE_LAUNCHER_FORCE_COLORS: "true"
508     TIMEOUT_FACTOR: "2"
509     CARGO_HOME: "/cache/gstreamer/cargo"
510   rules:
511     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-examples|gst-docs)$/'
512   script:
513     - *gst_build
514
515     - echo "-> Running ${TEST_SUITE}"
516     - >
517       ./gst-uninstalled.py
518       gst-validate-launcher ${TEST_SUITE}
519       --dump-on-failure
520       --mute
521       --shuffle
522       --no-display
523       --meson-no-rebuild
524       --timeout-factor "${TIMEOUT_FACTOR}"
525       --fail-on-testlist-change
526       -l "${CI_PROJECT_DIR}/validate-logs/"
527       --xunit-file "${CI_PROJECT_DIR}/validate-logs/xunit.xml"
528       ${EXTRA_VALIDATE_ARGS}
529   after_script:
530     - mv gst-build/build/meson-logs/ meson-logs
531     # Cleanup everything else to reduce the size
532     # of the docker volume we leave behind
533     - rm -rf gst-build
534   artifacts:
535     expire_in: '14 days'
536     when: always
537     paths:
538       - 'meson-logs/'
539       - 'validate-logs'
540       - 'manifest.xml'
541     reports:
542       junit:
543         - "validate-logs/*.xml"
544
545 .test fedora x86_64:
546   image: $FEDORA_IMAGE
547   extends: '.test'
548   tags: ['gstreamer']
549
550 check fedora:
551   extends: '.test fedora x86_64'
552   variables:
553     TEST_SUITE: "check.gst*"
554   rules:
555     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
556
557 integration testsuites fedora:
558   extends: '.test fedora x86_64'
559   parallel: 4
560   variables:
561     EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --check-bugs --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX}"
562     TEST_SUITE: "validate ges"
563   rules:
564     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-examples|gst-omx|gstreamer-sharp|gst-plugins-rs)$/'
565
566 gstreamer-full:
567   extends: 'build static fedora x86_64'
568   stage: integrate
569   variables:
570     MESON_ARGS: >
571       --default-library=static
572       -Dauto_features=disabled
573       -Dgst-plugins-good:alpha=enabled
574       $MESON_GST_WERROR
575   rules:
576     - if: '$CI_PROJECT_NAME =~ /^(gst-build|gst-ci)$/'
577
578   after_script:
579   - cd gst-build/
580   - ninja -C build install
581   - export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib64/gstreamer-1.0/pkgconfig
582   - export LD_LIBRARY_PATH=/usr/local/lib64
583   - cd examples/static-plugins
584   - meson _build
585   - ninja -C _build
586   - meson test -C _build -v
587   artifacts:
588     expire_in: "7 days"
589     when: "always"
590     paths:
591       - 'gst-build/build/meson-logs/'
592       - 'gst-build/build/gstinitstaticplugins.c'
593
594 # Valgrind
595 .valgrind fedora x86_64:
596   extends: '.test fedora x86_64'
597   stage: 'test'
598   variables:
599     EXTRA_VALIDATE_ARGS: "--valgrind"
600
601 valgrind core:
602   extends: '.valgrind fedora x86_64'
603   variables:
604     TEST_SUITE: "check.gstreamer\\..*"
605   rules:
606     - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-ci|gst-devtools)$/'
607
608 valgrind base:
609   extends: '.valgrind fedora x86_64'
610   variables:
611     TEST_SUITE: "check.gst-plugins-base\\..*"
612   rules:
613     - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-ci|gst-devtools)$/'
614
615 valgrind good:
616   extends: '.valgrind fedora x86_64'
617   variables:
618     TEST_SUITE: "check.gst-plugins-good\\..*"
619     # take longer time due to splitmux unit test
620     TIMEOUT_FACTOR: "4"
621   rules:
622     - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-ci|gst-devtools)$/'
623
624 valgrind ugly:
625   extends: '.valgrind fedora x86_64'
626   variables:
627     TEST_SUITE: "check.gst-plugins-ugly\\..*"
628   rules:
629     - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-ugly|gst-ci|gst-devtools)$/'
630
631 valgrind bad:
632   extends: '.valgrind fedora x86_64'
633   variables:
634     TEST_SUITE: "check.gst-plugins-bad\\..*"
635   rules:
636     - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-plugins-bad|gst-ci|gst-devtools)$/'
637
638 valgrind ges:
639   extends: '.valgrind fedora x86_64'
640   variables:
641     TEST_SUITE: "check.gst-editing-services\\..*"
642   rules:
643     - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-editing-services|gst-ci|gst-devtools)$/'
644
645 # Template for Cerbero GStreamer Build
646 #
647 # Parameters:
648 # CONFIG: The name of the configuration file to use
649 # ARCH: The cerbero <os>_<cpu> (used in cache key)
650 #
651 # Produces runtime and devel tarball packages for linux/android or .pkg for macos
652 .cerbero template: &cerbero_package_and_check
653   - $CERBERO $CERBERO_ARGS package --offline ${CERBERO_PACKAGE_ARGS} -o $(pwd) gstreamer-1.0
654   # Run gst-inspect-1.0 for some basic checks. Can't do this for cross-(android|ios)-universal, of course.
655   - |-
656       [[ $CONFIG == *universal* ]] || $CERBERO $CERBERO_ARGS run $CERBERO_RUN_WRAPPER gst-inspect-1.0$CERBERO_RUN_SUFFIX --version
657   - |-
658       [[ $CONFIG == *universal* ]] || $CERBERO $CERBERO_ARGS run $CERBERO_RUN_WRAPPER gst-inspect-1.0$CERBERO_RUN_SUFFIX
659   - test "x${HAVE_CCACHE}" = "xyes" && ccache -s || true    # eat the return value from the failing test
660
661 .cerbero:
662   stage: "build"
663   image: $CERBERO_IMAGE
664   rules:
665     - if: '$CI_PROJECT_NAME == "cerbero"'
666   needs:
667     - "manifest"
668   # Ensure that the runners it will be executed on
669   # will have plenty of space for the cache
670   tags: ['gstreamer']
671   timeout: '3h'
672   variables:
673     CCACHE_COMPILERCHECK: "content"
674     CCACHE_COMPRESS: "true"
675     CCACHE_BASEDIR: "/cache/gstreamer/cerbero/"
676     CCACHE_DIR: "/cache/gstreamer/cerbero/ccache/"
677     # shared across everything really
678     CCACHE_MAXSIZE: "50G"
679
680     CERBERO_HOME: "cerbero-build"
681     CERBERO_SOURCES: "cerbero-sources"
682     CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS}"
683     CERBERO: "./cerbero-uninstalled -c config/${CONFIG} -c localconf.cbc -m manifest.xml"
684     CERBERO_PACKAGE_ARGS: "-t"
685     CERBERO_RUN_WRAPPER: "" # 'wine' on cross-winXX
686     CERBERO_RUN_SUFFIX: "" # '.exe' on cross-winXX
687     HAVE_CCACHE: "yes"
688     # used by macos packages as we only ever install to a fixed directory
689     CERBERO_OVERRIDDEN_DIST_DIR: ""
690     # location where cerbero is cached on the host
691     CERBERO_HOST_DIR: "/cerbero/"
692   before_script:
693     # FIXME Wrong namespace
694     # Workaround build-tools having hardcoded internal path
695     - pwd
696     - mkdir -p ../../gstreamer
697     - ln -sf $(pwd) ../../gstreamer/cerbero
698     - mkdir -p ../../${CI_PROJECT_NAMESPACE}
699     - ln -sf $(pwd) ../../${CI_PROJECT_NAMESPACE}/cerbero
700     - rsync -aH ${CERBERO_HOST_DIR} .
701     - echo "home_dir = \"$(pwd)/${CERBERO_HOME}\"" >> localconf.cbc
702     - echo "local_sources = \"$(pwd)/${CERBERO_SOURCES}\"" >> localconf.cbc
703     - ./cerbero-uninstalled --self-update manifest.xml
704   script:
705     - test "x${HAVE_CCACHE}" = "xyes" && ccache --show-stats
706     - $CERBERO $CERBERO_ARGS show-config
707     - $CERBERO $CERBERO_ARGS fetch-bootstrap --build-tools-only
708     - $CERBERO $CERBERO_ARGS fetch-package --deps gstreamer-1.0
709     - $CERBERO $CERBERO_ARGS fetch-cache --branch ${GST_UPSTREAM_BRANCH}
710     - test "x${CERBERO_OVERRIDDEN_DIST_DIR}" != "x"
711           && test -d ${CERBERO_HOME}/dist/${ARCH}
712           && mkdir -p ${CERBERO_OVERRIDDEN_DIST_DIR}
713           && rsync -aH ${CERBERO_HOME}/dist/${ARCH}/ ${CERBERO_OVERRIDDEN_DIST_DIR}
714     - $CERBERO $CERBERO_ARGS bootstrap --offline --build-tools-only
715     - *cerbero_package_and_check
716   cache:
717     key: "${CI_JOB_NAME}"
718     paths:
719       - "${CERBERO_SOURCES}"
720   artifacts:
721     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
722     expire_in: '5 days'
723     when: 'always'
724     paths:
725       - "manifest.xml"
726       - "${CERBERO_HOME}/logs"
727       - "*.tar.*"
728
729 .build windows:
730   image: $WINDOWS_IMAGE
731   stage: 'build'
732   needs:
733     - 'manifest'
734   tags:
735     - 'docker'
736     - 'windows'
737     - '1809'
738   timeout: '45min'
739   variables:
740     MESON_ARGS: >
741       ${DEFAULT_MESON_ARGS}
742       -Dpython=disabled
743       -Dlibav=disabled
744       -Dvaapi=disabled
745       -Ddevtools=disabled
746   rules:
747     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs|gstreamer-vaapi)$/'
748   script:
749     # Sometimes there's seems to be an existing gst-build clone that comes either from the ether or
750     # from a previous job due to some gitlab bug or implicit behavior?
751     # So let's always check and clear it out if its there
752     # https://gitlab.freedesktop.org/tpm/gstreamer-sharp/-/jobs/1672137
753     - if (Test-Path $env:CI_PROJECT_DIR/gst-build) { Remove-Item -Recurse -Force $env:CI_PROJECT_DIR/gst-build }
754
755     # Make sure powershell exists on errors
756     # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
757     - $ErrorActionPreference = "Stop"
758
759     - 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
760     - python clone_manifest_ref.py --manifest manifest.xml --project gst-build --destination $env:CI_PROJECT_DIR/gst-build
761     - cd $env:CI_PROJECT_DIR/gst-build
762
763     - cp -r C:/subprojects/* subprojects/
764     # Run the git-update script and feed it the manifest to setup the environment
765     - cd $env:CI_PROJECT_DIR/gst-build;  python git-update --no-interaction --manifest=$env:CI_PROJECT_DIR/manifest.xml
766     # For some reason, options are separated by newline instead of space, so we
767     # have to replace them first.
768     - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
769     # Gitlab executes PowerShell in docker, but VsDevCmd.bat is a batch script.
770     # Environment variables substitutions is done by PowerShell before calling
771     # cmd.exe, that's why we use $env:FOO instead of %FOO%
772     - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
773         meson build $env:MESON_ARGS &&
774         ninja -C build"
775   # XXX: Re-enable when uploading stops timing out
776   #artifacts:
777   #  expire_in: "7 days"
778   #  when: "always"
779   #  paths:
780   #    - 'gst-build/build/meson-logs/'
781
782 build vs2017 amd64:
783   extends: '.build windows'
784   variables:
785     ARCH: 'amd64'
786
787 build vs2017 x86:
788   extends: '.build windows'
789   variables:
790     ARCH: 'x86'
791
792 build msys2 :
793   extends: '.build windows'
794   timeout: '60min'
795   rules:
796     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs|gstreamer-vaapi)$/'
797       allow_failure: true
798       when: 'manual'
799   script:
800     # Sometimes there's seems to be an existing gst-build clone that comes either from the ether or
801     # from a previous job due to some gitlab bug or implicit behavior?
802     # So let's always check and clear it out if its there
803     # https://gitlab.freedesktop.org/tpm/gstreamer-sharp/-/jobs/1672137
804     - if (Test-Path $env:CI_PROJECT_DIR/gst-build) { Remove-Item -Recurse -Force $env:CI_PROJECT_DIR/gst-build }
805
806     # Make sure powershell exists on errors
807     # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
808     - $ErrorActionPreference = "Stop"
809
810     # For some reason docker build hangs if this is included in the image, needs more troubleshooting
811     - $env:PATH += ';C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\msys64\mingw32\bin'
812     # Copied from https://github.com/msys2/setup-msys2/blob/master/main.js#L98
813     - C:\msys64\usr\bin\bash -c "pacman-key --init && pacman-key --populate msys2 && pacman-key --refresh-keys || true"
814     - C:\msys64\usr\bin\bash -c "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf"
815     - echo "Updating MSYS2"
816     - C:\msys64\usr\bin\bash -c "pacman -Syuu --noconfirm || echo Update failed, ignoring"
817     - echo "Killing all MSYS2 processes"
818     - taskkill /F /FI "MODULES eq msys-2.0.dll"
819     - echo "Completing MSYS2 update"
820     - C:\msys64\usr\bin\bash -c "pacman -Suu --noconfirm"
821     - echo "Installing needed MSYS2 packages"
822     - C:\msys64\usr\bin\bash -c "pacman -Sy --noconfirm --needed mingw-w64-x86_64-toolchain ninja"
823
824     - 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
825     - python clone_manifest_ref.py --manifest manifest.xml --project gst-build --destination $env:CI_PROJECT_DIR/gst-build
826     - cd $env:CI_PROJECT_DIR/gst-build
827
828     - cp -r C:\subprojects\* subprojects\
829
830     # Run the git-update script and feed it the manifest to setup the environment
831     - cd $env:CI_PROJECT_DIR/gst-build; python git-update --no-interaction --manifest=$env:CI_PROJECT_DIR/manifest.xml
832     # For some reason, options are separated by newline instead of space, so we
833     # have to replace them first.
834     - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
835     # Replace forward slashes with backwards so bash doesn't complain
836     - $env:_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\','/')
837     - C:\msys64\usr\bin\bash -c "cd $env:_PROJECT_DIR/gst-build &&
838         meson build $env:MESON_ARGS &&
839         ninja -C build"
840
841
842 # Template for Cerbero GStreamer Deps
843 #
844 # This template is used by cerbero/ project to pre-built the GStreamer
845 # dependencies. When available, the .cerbero jobs will download this artifact
846 # in order to speed up the build.
847 #
848 # Parameters:
849 # CONFIG: The name of the configuration file to use
850 # ARCH: The cerbero <os>_<cpu> (used in cache key)
851 #
852 # Produce an artifact with the dist/ and .cache along
853 # with the associated build-tools.
854 .cerbero deps:
855   extends: .cerbero
856   rules:
857     - if: '$CI_PROJECT_NAME == "cerbero"'
858   script:
859     - test "x${HAVE_CCACHE}" = "xyes" && ccache --show-stats
860     - $CERBERO $CERBERO_ARGS show-config
861     - $CERBERO $CERBERO_ARGS fetch-bootstrap --build-tools-only
862     - $CERBERO $CERBERO_ARGS fetch-package --deps gstreamer-1.0
863     - $CERBERO $CERBERO_ARGS bootstrap --offline --build-tools-only
864     - $CERBERO $CERBERO_ARGS build-deps --offline
865           gstreamer-1.0 gst-plugins-base-1.0 gst-plugins-good-1.0
866           gst-plugins-bad-1.0 gst-plugins-ugly-1.0 gst-rtsp-server-1.0
867           gst-libav-1.0 gst-devtools-1.0 gst-editing-services-1.0 libnice
868     - test "x${CERBERO_OVERRIDDEN_DIST_DIR}" != "x"
869           && mkdir -p ${CERBERO_HOME}/dist/${ARCH}
870           && rsync -aH ${CERBERO_OVERRIDDEN_DIST_DIR}/ ${CERBERO_HOME}/dist/${ARCH}
871     - $CERBERO $CERBERO_ARGS gen-cache --branch ${GST_UPSTREAM_BRANCH}
872     - test "x${CERBERO_PRIVATE_SSH_KEY}" = "x"
873           || $CERBERO $CERBERO_ARGS upload-cache --branch ${GST_UPSTREAM_BRANCH}
874     - *cerbero_package_and_check
875
876 #
877 # Cerbero Linux X86_64 build
878 #
879 cerbero deps fedora x86_64:
880   extends: '.cerbero deps'
881   variables:
882     CONFIG: "linux.config"
883     ARCH: "linux_x86_64"
884
885 build cerbero fedora x86_64:
886   extends: '.cerbero'
887   rules:
888     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'
889   variables:
890     CONFIG: "linux.config"
891
892 #
893 # Cerbero Android Universal build
894 #
895 .cerbero cross-android universal:
896   variables:
897     CONFIG: "cross-android-universal.cbc"
898     ARCH: "android_universal"
899   artifacts:
900     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
901     expire_in: '5 days'
902     when: 'always'
903     paths:
904       - "manifest.xml"
905       - "${CERBERO_HOME}/logs"
906       - "*[0-9].tar.*"
907
908 cerbero deps cross-android universal:
909   extends:
910     - '.cerbero deps'
911     - '.cerbero cross-android universal'
912
913 build cerbero cross-android universal:
914   extends:
915     - '.cerbero'
916     - '.cerbero cross-android universal'
917   rules:
918     - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME && $CI_PROJECT_NAME == "gst-docs"'
919     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
920
921 #
922 # Cerbero Cross Windows builds
923 #
924 cerbero deps cross-windows x86:
925   extends: '.cerbero deps'
926   variables:
927     CONFIG: "cross-win32.cbc"
928     ARCH: "mingw_x86"
929
930 build cerbero cross win32:
931   extends: '.cerbero'
932   rules:
933     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'
934   variables:
935     CONFIG: "cross-win32.cbc"
936     CERBERO_RUN_WRAPPER: "wine"
937     CERBERO_RUN_SUFFIX: ".exe"
938
939
940 cerbero deps cross-windows x86_64:
941   extends: '.cerbero deps'
942   variables:
943     CONFIG: "cross-win64.cbc"
944     ARCH: "mingw_x86_64"
945
946 build cerbero cross win64:
947   extends: '.cerbero'
948   rules:
949     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'
950   variables:
951     CONFIG: "cross-win64.cbc"
952     CERBERO_RUN_WRAPPER: "wine"
953     CERBERO_RUN_SUFFIX: ".exe"
954
955 #
956 # Build an Android App using the android binaries
957 #
958 .cross-android universal examples:
959   image: $ANDROID_IMAGE
960   stage: 'integrate'
961   variables:
962     EXAMPLES_HOME: ${CI_PROJECT_DIR}/examples
963     GSTREAMER_ROOT_ANDROID: ${CI_PROJECT_DIR}/examples/cerbero-android-universal
964   script:
965     - mkdir -p ${EXAMPLES_HOME}/outputs
966     - curl -L -o clone_manifest_ref.py https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/clone_manifest_ref.py
967     - chmod +x clone_manifest_ref.py
968     - ./clone_manifest_ref.py --manifest manifest.xml --project gst-examples --destination ${EXAMPLES_HOME}/gst-examples
969     - ./clone_manifest_ref.py --manifest manifest.xml --project gst-docs --destination ${EXAMPLES_HOME}/gst-docs
970     - rm clone_manifest_ref.py
971
972     # extract our binaries
973     - rm -f gstreamer-1.0-android-universal-*-runtime.tar.*
974     - mkdir ${GSTREAMER_ROOT_ANDROID}
975     - time tar -C ${GSTREAMER_ROOT_ANDROID} -xf gstreamer-1.0-android-universal-*.tar.*
976
977     # gst-examples - player
978     - chmod +x ${EXAMPLES_HOME}/gst-examples/playback/player/android/gradlew
979     - ${EXAMPLES_HOME}/gst-examples/playback/player/android/gradlew --no-daemon --project-dir ${EXAMPLES_HOME}/gst-examples/playback/player/android assembleDebug
980     - cp ${EXAMPLES_HOME}/gst-examples/playback/player/android/app/build/outputs/apk/debug/*.apk ${EXAMPLES_HOME}/outputs/
981
982     # gst-examples - vulkan
983     - chmod +x ${EXAMPLES_HOME}/gst-examples/vulkan/android/gradlew
984     - ${EXAMPLES_HOME}/gst-examples/vulkan/android/gradlew --no-daemon --project-dir ${EXAMPLES_HOME}/gst-examples/vulkan/android assembleDebug
985     - cp ${EXAMPLES_HOME}/gst-examples/vulkan/android/build/outputs/apk/debug/*.apk ${EXAMPLES_HOME}/outputs/
986
987     # gst-docs android tutorials
988     - chmod +x ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android/gradlew
989     - ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android/gradlew --no-daemon --project-dir ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android assembleDebug
990     - cp ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android/android-tutorial-*/build/outputs/apk/debug/*.apk ${EXAMPLES_HOME}/outputs/
991   after_script:
992     - rm -rf ${GSTREAMER_ROOT_ANDROID}
993     - rm -rf ${EXAMPLES_HOME}/gst-examples ${EXAMPLES_HOME}/gst-docs
994   artifacts:
995     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
996     expire_in: '5 days'
997     when: 'always'
998     paths:
999       - "manifest.xml"
1000       - "${EXAMPLES_HOME}/outputs"
1001
1002 cross-android universal examples:
1003   extends: ".cross-android universal examples"
1004   rules:
1005     - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME && $CI_PROJECT_NAME == "gst-docs"'
1006     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
1007   needs:
1008     - "build cerbero cross-android universal"
1009
1010 cerbero cross-android universal examples:
1011   extends: ".cross-android universal examples"
1012   rules:
1013     - if: '$CI_PROJECT_NAME == "cerbero"'
1014   needs:
1015     - "cerbero deps cross-android universal"
1016
1017 #
1018 # Cerbero macOS X86_64 build
1019 #
1020 .cerbero macos x86_64:
1021   variables:
1022     ARCH: "darwin_x86_64"
1023     CONFIG: "osx-x86-64.cbc"
1024     CERBERO_PACKAGE_ARGS: ""
1025     HAVE_CCACHE: ""
1026     CERBERO_OVERRIDDEN_DIST_DIR: "/Library/Frameworks/GStreamer.framework/Versions/1.0"
1027     CERBERO_HOST_DIR: "/Users/gst-ci/cerbero/"
1028   tags:
1029     - gst-macos-10.15
1030   artifacts:
1031     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
1032     expire_in: '5 days'
1033     when: 'always'
1034     paths:
1035       - "manifest.xml"
1036       - "${CERBERO_HOME}/logs"
1037       - "gstreamer-1.0-1.*.pkg"
1038       - "gstreamer-1.0-devel-1.*.pkg"
1039
1040 cerbero deps macos x86_64:
1041   extends:
1042     - '.cerbero deps'
1043     - '.cerbero macos x86_64'
1044
1045 build cerbero macos x86_64:
1046   extends:
1047     - '.cerbero'
1048     - '.cerbero macos x86_64'
1049   rules:
1050     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gst-sharp|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
1051
1052 #
1053 # Cerbero iOS build
1054 #
1055 .cerbero cross-ios universal:
1056   variables:
1057     ARCH: "ios_universal"
1058     CONFIG: "cross-ios-universal.cbc"
1059     CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS} -v nowerror"
1060     CERBERO_PACKAGE_ARGS: ""
1061     HAVE_CCACHE: ""
1062     CERBERO_HOST_DIR: "/Users/gst-ci/cerbero/"
1063   tags:
1064     - gst-ios-13.2
1065   artifacts:
1066     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
1067     expire_in: '5 days'
1068     when: 'always'
1069     paths:
1070       - "manifest.xml"
1071       - "${CERBERO_HOME}/logs"
1072       - "gstreamer-1.0-*-ios-universal.pkg"
1073
1074 cerbero deps cross-ios universal:
1075   extends:
1076     - '.cerbero deps'
1077     - '.cerbero cross-ios universal'
1078
1079 build cerbero cross-ios universal:
1080   extends:
1081     - '.cerbero'
1082     - '.cerbero cross-ios universal'
1083   rules:
1084     - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME && $CI_PROJECT_NAME == "gst-docs"'
1085     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gst-sharp|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
1086
1087 documentation:
1088   image: $FEDORA_DOCS_IMAGE
1089   extends:
1090     - '.gst_build_ccache_vars'
1091   rules:
1092     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-integration-testsuites|gst-plugins-rs|gst-python)$/'
1093   needs:
1094     - "manifest"
1095   stage: integrate
1096   variables:
1097     MESON_ARGS: *simple_build
1098     MESON_BUILDTYPE_ARGS: "-Ddoc=enabled"
1099     CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
1100   script:
1101   - pip3 install --upgrade git+https://github.com/hotdoc/hotdoc@28ad9aa59daa49d6b3fd1bc6b144df52af39475b
1102   - *gst_build
1103   - ./gst-uninstalled.py ninja -C build/ plugins_doc_caches
1104   - |
1105     python3 -c "import os, subprocess, sys
1106     subprojects = [os.environ['CI_PROJECT_NAME']]
1107     if subprojects[0]  in ['gst-ci', 'gst-build']:
1108         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',]
1109
1110     diffsdir = '../plugins-cache-diffs'
1111     os.makedirs(diffsdir, exist_ok=True)
1112     res = 0
1113     for subproject in subprojects:
1114         cwd = os.path.join('subprojects', subproject)
1115         try:
1116             subprocess.check_call(['git', 'diff', '--quiet'], cwd=cwd)
1117         except subprocess.CalledProcessError:
1118             diffname = os.path.join(diffsdir, '%s_cache.diff' % subproject)
1119             res += 1
1120             with open(diffname, 'w') as diff:
1121                 subprocess.check_call(['git', 'diff'], stdout=diff, cwd=cwd)
1122                 print('\033[91mYou have a diff in the %s documentation cache. Please update with:\033[0m' % subproject)
1123                 print('     $ curl %s/%s | git apply -' % (os.environ['CI_ARTIFACTS_URL'], diffname.replace('../', '')))
1124     if res != 0:
1125         print('(note that it might take a few minutes for artefacts to be available on the server)\n')
1126         sys.exit(res)"
1127
1128   - ./gst-uninstalled.py hotdoc run --conf-file=build/subprojects/gst-docs/GStreamer-doc.json --fatal-warnings
1129   - cd -
1130   - mv gst-build/build/subprojects/gst-docs/GStreamer-doc/html documentation/
1131
1132   artifacts:
1133     when: always
1134     paths:
1135     - documentation/
1136     - plugins-cache-diffs/
1137
1138 #
1139 # Build an iOS App using the iOS binaries
1140 #
1141 .cross-ios universal examples:
1142   stage: 'integrate'
1143   variables:
1144     EXAMPLES_HOME: ${CI_PROJECT_DIR}/examples
1145     # disable codesigning so we don't need developer identities on the CI
1146     # machines
1147     XCODE_BUILD_ARGS: >
1148       CODE_SIGNING_REQUIRED="NO"
1149       CODE_SIGN_IDENTITY=""
1150       CODE_SIGNING_ALLOWED="NO"
1151       CODE_SIGN_ENTITLEMENTS=""
1152   script:
1153     # install the binaries
1154     - installer -pkg gstreamer-1.0-devel-*-ios-universal.pkg -target CurrentUserHomeDirectory -verbose
1155
1156     - curl -L -o clone_manifest_ref.py https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/clone_manifest_ref.py
1157     - chmod +x clone_manifest_ref.py
1158     - ./clone_manifest_ref.py --manifest manifest.xml --project gst-examples --destination ${EXAMPLES_HOME}/gst-examples
1159     - ./clone_manifest_ref.py --manifest manifest.xml --project gst-docs --destination ${EXAMPLES_HOME}/gst-docs
1160     - rm clone_manifest_ref.py
1161
1162     # dump some useful information
1163     - xcodebuild -version
1164     - xcodebuild -showsdks
1165
1166     # gst-docs ios tutorials
1167     - xcodebuild -showBuildSettings -alltargets -project ${EXAMPLES_HOME}/gst-docs/examples/tutorials/xcode\ iOS/GStreamer\ iOS\ Tutorials.xcodeproj
1168     - xcodebuild -alltargets -destination generic/platform=iOS -project ${EXAMPLES_HOME}/gst-docs/examples/tutorials/xcode\ iOS/GStreamer\ iOS\ Tutorials.xcodeproj ${XCODE_BUILD_ARGS}
1169
1170     # gst-examples
1171     - xcodebuild -showBuildSettings -alltargets -project ${EXAMPLES_HOME}/gst-examples/playback/player/ios/GstPlay.xcodeproj
1172     - xcodebuild -alltargets -destination generic/platform=iOS -project ${EXAMPLES_HOME}/gst-examples/playback/player/ios/GstPlay.xcodeproj ${XCODE_BUILD_ARGS}
1173   after_script:
1174     - rm -rf ${EXAMPLES_HOME}/gst-examples ${EXAMPLES_HOME}/gst-docs
1175   tags:
1176     - gst-ios-13.2
1177
1178 cross-ios universal examples:
1179   extends: ".cross-ios universal examples"
1180   rules:
1181     - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME && $CI_PROJECT_NAME == "gst-docs"'
1182     - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
1183   needs:
1184     - "build cerbero cross-ios universal"
1185
1186 cerbero cross-ios universal examples:
1187   extends: ".cross-ios universal examples"
1188   rules:
1189     - if: '$CI_PROJECT_NAME == "cerbero"'
1190   needs:
1191     - "cerbero deps cross-ios universal"
1192
1193 build gst-omx zynq fedora x86_64:
1194   extends: '.build fedora x86_64'
1195   variables:
1196     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"
1197   rules:
1198     - if: '$CI_PROJECT_NAME =~ /^(gst-omx|gst-ci)$/'
1199   before_script:
1200     - git clone https://github.com/Xilinx/vcu-omx-il.git --branch=release-2020.1 ${CI_PROJECT_DIR}/vcu-omx-il
1201
1202 build gst-omx tizonia fedora x86_64:
1203   extends: '.build fedora x86_64'
1204   variables:
1205     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"
1206     PKG_CONFIG_PATH: ${PKG_CONFIG_PATH}:${CI_PROJECT_DIR}/tizonia-install/lib64/pkgconfig/
1207   rules:
1208     - if: '$CI_PROJECT_NAME =~ /^(gst-omx|gst-ci)$/'
1209   before_script:
1210     - git clone https://github.com/tizonia/tizonia-openmax-il --branch v0.20.2
1211     - cd tizonia-openmax-il
1212     - meson build -Dclients=false -Dplugins='' -Dplayer=false -Dprefix=${CI_PROJECT_DIR}/tizonia-install
1213     - ninja -C build
1214     - ninja -C build install
1215     - cd ..