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