ci_template: Add an auto-retry policy
[platform/upstream/gstreamer.git] / gitlab / ci_template.yml
1 stages:
2   - 'preparation'
3   - 'pre-build'
4   - 'build'
5   - 'test'
6   # Use the resulting binaries
7   - 'integrate'
8
9 variables:
10   ANDROID_IMAGE: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/android:2019-06-12-354260'
11   CERBERO_IMAGE: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/cerbero-fedora:2019-09-24-648163'
12   FEDORA_IMAGE: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/fedora:2019-05-29-324578'
13   INDENT_IMAGE: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/gst-indent:6f7e01e1e30a73efa880acdc8e911f1f20c58dbb'
14   MANIFEST_IMAGE: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/build-manifest:d19082b72667fb3382bdc3621520c4d26e258b2e'
15   WINDOWS_IMAGE: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/windows:v6'
16
17   # Branch to track for modules that have no ref specified in the manifest
18   GST_UPSTREAM_BRANCH: 'master'
19   ORC_UPSTREAM_BRANCH: 'master'
20
21   GIT_STRATEGY: none
22   MESON_BUILDTYPE_ARGS: --default-library=both
23   DEFAULT_MESON_ARGS: >
24     -Dpython=enabled
25     -Dlibav=enabled
26     -Dugly=enabled
27     -Dbad=enabled
28     -Ddevtools=enabled
29     -Dges=enabled
30     -Drtsp_server=enabled
31     -Dvaapi=enabled
32     -Dsharp=disabled
33
34   DEFAULT_CERBERO_ARGS: >
35     --variants werror
36     --timestamps
37
38 .global_retry_policy:
39   retry:
40     max: 2
41     when:
42       - 'runner_system_failure'
43       - 'api_failure'
44
45 manifest:
46   image: $MANIFEST_IMAGE
47   extends:
48     - '.global_retry_policy'
49   stage: 'preparation'
50   script:
51     - cd /gst-ci
52     - gitlab/build_manifest.py --self-update
53     - gitlab/build_manifest.py ${CI_PROJECT_DIR}/manifest.xml
54     - cat ${CI_PROJECT_DIR}/manifest.xml
55   artifacts:
56     expire_in: "7 days"
57     paths:
58       - "manifest.xml"
59
60 gst indent:
61   image: $INDENT_IMAGE
62   extends:
63     - '.global_retry_policy'
64   stage: 'preparation'
65   variables:
66     GIT_STRATEGY: 'fetch'
67   script:
68     # man indent. grep RETURN VALUE, grab a beer on my behalf...
69     - indent --version || true
70     - curl -o gst-indent https://gitlab.freedesktop.org/gstreamer/gstreamer/raw/${GST_UPSTREAM_BRANCH}/tools/gst-indent
71     - chmod +x gst-indent
72     - find . -name '*.c' -exec ./gst-indent {} +
73     - |
74       if git diff --quiet; then
75           echo "Code is properly formatted"
76       else
77           git diff --color=always
78           echo 'style diverges, please run gst-indent first'
79           exit 1
80       fi
81   except:
82     variables:
83       # No point on trying to format C files in those repositories
84       - $CI_PROJECT_NAME == "gstreamer-sharp"
85       - $CI_PROJECT_NAME == "gst-integration-testsuites"
86       - $CI_PROJECT_NAME == "cerbero"
87       - $CI_PROJECT_NAME == "gst-docs"
88
89 .build:
90   stage: 'build'
91   extends:
92     - '.global_retry_policy'
93   needs:
94     - "manifest"
95   dependencies:
96     - "manifest"
97   variables:
98     CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
99     CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"
100     MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} --werror"
101
102   script:
103     - ccache -z
104     - curl -o clone_manifest_ref.py https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/clone_manifest_ref.py
105     - chmod +x clone_manifest_ref.py
106     - ./clone_manifest_ref.py --manifest manifest.xml --project gst-build --destination gst-build
107     - cd gst-build/
108     # only copy immediate directories. We don't want to modify .wrap files
109     - find /gst-build/subprojects/ -mindepth 1 -maxdepth 1 -type d -exec cp -r \{\} subprojects/ \;
110     - ./git-update --no-interaction --manifest="${CI_PROJECT_DIR}/manifest.xml"
111     - meson build/ $MESON_ARGS
112     - ninja -C build/
113     - ccache -s
114   after_script:
115     - cd gst-build/
116     # Clean the artifacts packages to avoid copying "useless" build products.
117     - test -d build && find build -name '*.[ao]' -delete
118     # Clean the .git repos since we won't need them anymore
119     - rm -rf subprojects/*/.git/
120     - rm -rf build/subprojects/*/.git/
121   cache:
122     key: "${CI_JOB_NAME}"
123     paths:
124       - "${CCACHE_DIR}"
125   except:
126     variables:
127       - $CI_PROJECT_NAME == "cerbero"
128
129 build fedora x86_64:
130   extends: '.build'
131   stage: 'build'
132   image: $FEDORA_IMAGE
133   variables:
134     MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Domx=enabled -Dgst-omx:target=generic -Ddoc=enabled ${MESON_BUILDTYPE_ARGS} --werror"
135   artifacts:
136     expire_in: '5 days'
137     when: always
138     paths:
139       - "manifest.xml"
140       - "gst-build/"
141   except:
142     variables:
143       - $CI_PROJECT_NAME == "cerbero"
144
145 build nodebug fedora x86_64:
146   extends: '.build'
147   stage: 'build'
148   image: $FEDORA_IMAGE
149   variables:
150     MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} --werror"
151   except:
152     variables:
153       - $CI_PROJECT_NAME == "cerbero"
154       - $CI_PROJECT_NAME == "gst-docs"
155
156 build static fedora x86_64:
157   extends: 'build fedora x86_64'
158   variables:
159     MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
160   except:
161     variables:
162       - $CI_PROJECT_NAME == "cerbero"
163       - $CI_PROJECT_NAME == "gst-docs"
164
165 build static nodebug fedora x86_64:
166   extends: 'build nodebug fedora x86_64'
167   variables:
168     MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
169   except:
170     variables:
171       - $CI_PROJECT_NAME == "cerbero"
172       - $CI_PROJECT_NAME == "gst-docs"
173
174 build clang fedora x86_64:
175   extends: 'build fedora x86_64'
176   variables:
177     CC: 'ccache clang'
178     CXX: 'ccache clang++'
179   except:
180     variables:
181       - $CI_PROJECT_NAME == "cerbero"
182       - $CI_PROJECT_NAME == "gst-docs"
183
184 .test:
185   stage: 'test'
186   extends:
187     - '.global_retry_policy'
188   variables:
189     # Disable colored output to avoid weird rendering issues
190     GST_DEBUG_NO_COLOR: "true"
191     CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/validate-logs/"
192     GST_VALIDATE_LAUNCHER_FORCE_COLORS: "true"
193     width: 100
194     COLUMNS: 100
195   script:
196     - cd gst-build/
197     - echo "-> Running ${TEST_SUITE}"
198     - >
199       ./gst-uninstalled.py
200       gst-validate-launcher ${TEST_SUITE}
201       --dump-on-failure
202       --mute
203       --shuffle
204       --no-display
205       --meson-no-rebuild
206       --fail-on-testlist-change
207       -l "${CI_PROJECT_DIR}/validate-logs/"
208       --xunit-file "${CI_PROJECT_DIR}/validate-logs/xunit.xml"
209       ${EXTRA_VALIDATE_ARGS}
210   artifacts:
211     expire_in: '14 days'
212     when: always
213     paths:
214       - 'gst-build/build/meson-logs/'
215       - 'validate-logs'
216     reports:
217       junit:
218         - "validate-logs/*.xml"
219   # We disable the .build above, which this job usually depends upon for cerbero
220   except:
221     variables:
222       - $CI_PROJECT_NAME == "cerbero"
223       - $CI_PROJECT_NAME == "gst-examples"
224       - $CI_PROJECT_NAME == "gst-docs"
225
226 .test fedora x86_64:
227   image: $FEDORA_IMAGE
228   extends: '.test'
229   needs:
230     - 'build fedora x86_64'
231   dependencies:
232     - build fedora x86_64
233
234 check fedora:
235   extends: '.test fedora x86_64'
236   variables:
237     TEST_SUITE: "check.gst*"
238   except:
239     variables:
240       - $CI_PROJECT_NAME == "gst-integration-testsuites"
241       - $CI_PROJECT_NAME == "cerbero"
242       - $CI_PROJECT_NAME == "gst-examples"
243       - $CI_PROJECT_NAME == "gst-omx"
244       - $CI_PROJECT_NAME == "gst-docs"
245
246 integration testsuites fedora:
247   extends: '.test fedora x86_64'
248   before_script:
249     - rm -f gst-build/build/subprojects/gstreamer-vaapi/gst/vaapi/libgstvaapi.so
250   variables:
251     EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --check-bugs"
252     TEST_SUITE: "validate ges"
253   except:
254     variables:
255       - $CI_PROJECT_NAME == "gst-omx"
256       - $CI_PROJECT_NAME == "gstreamer-vaapi"
257       - $CI_PROJECT_NAME == "cerbero"
258       - $CI_PROJECT_NAME == "gst-docs"
259
260 # Valgrind
261 .valgrind fedora x86_64:
262   extends: '.test fedora x86_64'
263   stage: 'test'
264   variables:
265     EXTRA_VALIDATE_ARGS: "--valgrind"
266   # Some suppression files are missing a newline at the end which messes things
267   # up when concatenating them. awk will add missing newlines (unlike cat)
268   except:
269     variables:
270       - $CI_PROJECT_NAMESPACE == 'gstreamer'
271
272 valgrind core:
273   extends: '.valgrind fedora x86_64'
274   variables:
275     TEST_SUITE: "check.gstreamer\\..*"
276   only:
277     variables:
278       - $CI_PROJECT_NAME =~ /^(gstreamer|gst-ci)$/
279
280 valgrind base:
281   extends: '.valgrind fedora x86_64'
282   variables:
283     TEST_SUITE: "check.gst-plugins-base\\..*"
284   only:
285     variables:
286       - $CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-ci)$/
287
288 valgrind good:
289   extends: '.valgrind fedora x86_64'
290   variables:
291     TEST_SUITE: "check.gst-plugins-good\\..*"
292   only:
293     variables:
294       - $CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-ci)$/
295
296 valgrind ugly:
297   extends: '.valgrind fedora x86_64'
298   variables:
299     TEST_SUITE: "check.gst-plugins-ugly\\..*"
300   only:
301     variables:
302       - $CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-ugly|gst-ci)$/
303
304 valgrind bad:
305   extends: '.valgrind fedora x86_64'
306   variables:
307     TEST_SUITE: "check.gst-plugins-bad\\..*"
308   only:
309     variables:
310       - $CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-plugins-bad|gst-ci)$/
311
312 valgrind ges:
313   extends: '.valgrind fedora x86_64'
314   variables:
315     TEST_SUITE: "check.gst-editing-services\\..*"
316   only:
317     variables:
318       - $CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-editing-services|gst-ci)$/
319
320 # Template for Cerbero GStreamer Build
321 #
322 # Parameters:
323 # CONFIG: The name of the configuration file to use
324 # ARCH: The cerbero <os>_<cpu> (used in cache key)
325 #
326 # Produces runtime and devel tarball packages for linux/android or .pkg for macos
327 .cerbero:
328   stage: "build"
329   image: $CERBERO_IMAGE
330   extends:
331     - '.global_retry_policy'
332   needs:
333     - "manifest"
334   dependencies:
335     - "manifest"
336   variables:
337     CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
338     CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"
339     CCACHE_MAXSIZE: "1.7G"
340     CERBERO_HOME: "cerbero-build"
341     CERBERO_SOURCES: "cerbero-sources"
342     CERBERO_DEPS: "cerbero-deps.tar.gz"
343     CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS}"
344     CERBERO: "./cerbero-uninstalled -c config/${CONFIG} -c localconf.cbc -m manifest.xml"
345     CERBERO_PACKAGE_ARGS: "-t"
346     HAVE_CCACHE: "yes"
347     # used by macos packages as we only ever install to a fixed directory
348     CERBERO_OVERRIDDEN_DIST_DIR: ""
349   before_script:
350     # FIXME Wrong namespace
351     # Workaround build-tools having hardcoded internal path
352     - pwd
353     - mkdir -p ../../gstreamer
354     - ln -sf $(pwd) ../../gstreamer/cerbero
355     - mkdir -p ../../${CI_PROJECT_NAMESPACE}
356     - ln -sf $(pwd) ../../${CI_PROJECT_NAMESPACE}/cerbero
357     - rsync -aH /cerbero/ .
358     - test -f ${CERBERO_DEPS} && tar -C ${CERBERO_HOME} -xf ${CERBERO_DEPS}
359     - echo "home_dir = \"$(pwd)/${CERBERO_HOME}\"" >> localconf.cbc
360     - echo "local_sources = \"$(pwd)/${CERBERO_SOURCES}\"" >> localconf.cbc
361     - ./cerbero-uninstalled --self-update manifest.xml
362   script:
363     - test "x${HAVE_CCACHE}" = "xyes" && ccache -z
364     - $CERBERO $CERBERO_ARGS show-config
365     - $CERBERO $CERBERO_ARGS fetch-bootstrap --build-tools-only
366     - $CERBERO $CERBERO_ARGS fetch-package --deps gstreamer-1.0
367     - $CERBERO $CERBERO_ARGS fetch-cache --branch ${GST_UPSTREAM_BRANCH}
368     - test "x${CERBERO_OVERRIDDEN_DIST_DIR}" != "x"
369           && test -d ${CERBERO_HOME}/dist/${ARCH}
370           && mkdir -p ${CERBERO_OVERRIDDEN_DIST_DIR}
371           && rsync -aH ${CERBERO_HOME}/dist/${ARCH}/ ${CERBERO_OVERRIDDEN_DIST_DIR}
372     - $CERBERO $CERBERO_ARGS bootstrap --offline --build-tools-only
373     - $CERBERO $CERBERO_ARGS package --offline ${CERBERO_PACKAGE_ARGS} -o $(pwd) gstreamer-1.0
374     - test "x${HAVE_CCACHE}" = "xyes" && ccache -s || true    # eat the return value from the failing test
375   except:
376     variables:
377       - $CI_PROJECT_NAME == "gst-build"
378       - $CI_PROJECT_NAME == "gst-docs"
379   cache:
380     key: "${CI_JOB_NAME}"
381     paths:
382       - "${CCACHE_DIR}"
383       - "${CERBERO_SOURCES}"
384   artifacts:
385     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
386     expire_in: '5 days'
387     when: 'always'
388     paths:
389       - "manifest.xml"
390       - "${CERBERO_HOME}/logs"
391       - "*.tar.bz2"
392
393 .build windows:
394   image: $WINDOWS_IMAGE
395   extends:
396     - '.global_retry_policy'
397   stage: 'build'
398   needs:
399     - 'manifest'
400   dependencies:
401     - 'manifest'
402   tags:
403     - 'docker'
404     - 'windows'
405     - '1607'
406   variables:
407     MESON_ARGS: >
408       ${DEFAULT_MESON_ARGS}
409       -Dpython=disabled
410       -Dlibav=disabled
411       -Dvaapi=disabled
412       -Ddevtools=disabled
413   script:
414     - git clone https://gitlab.freedesktop.org/gstreamer/gst-build.git $env:CI_PROJECT_DIR/gst-build
415     - cd $env:CI_PROJECT_DIR/gst-build
416     - cp -r C:/subprojects/* subprojects/
417     # For some reason, options are separated by newline instead of space, so we
418     # have to replace them first.
419     - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
420     # Gitlab executes PowerShell in docker, but VsDevCmd.bat is a batch script.
421     # Environment variables substitutions is done by PowerShell before calling
422     # cmd.exe, that's why we use $env:FOO instead of %FOO%
423     - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
424         python git-update --no-interaction --manifest=$env:CI_PROJECT_DIR/manifest.xml &&
425         meson build $env:MESON_ARGS &&
426         ninja -C build"
427   # FIXME: extract builddir for tests
428   # There's a bug that prevents us from exporting artifacts with docker-windows
429   # executors. It has since been fixed in gitlab 12.1, but
430   # we are blocked from upgrading currently.
431   #
432   # Gitlab Runner issue: https://gitlab.com/gitlab-org/gitlab-runner/issues/4291
433   # Blocked upgrade issue: https://gitlab.freedesktop.org/gstreamer/gst-ci/issues/6#note_192780
434   after_script:
435   except:
436     variables:
437       - $CI_PROJECT_NAME == "cerbero"
438       - $CI_PROJECT_NAME == "gst-omx"
439       - $CI_PROJECT_NAME == "gstreamer-vaapi"
440       - $CI_PROJECT_NAME == "gst-docs"
441
442 build vs2017 amd64:
443   extends: '.build windows'
444   variables:
445     ARCH: 'amd64'
446
447 build vs2017 x86:
448   extends: '.build windows'
449   variables:
450     ARCH: 'x86'
451
452 build msys2 :
453   extends: '.build windows'
454   script:
455     - git clone https://gitlab.freedesktop.org/gstreamer/gst-build.git $env:CI_PROJECT_DIR/gst-build
456     - cd $env:CI_PROJECT_DIR/gst-build
457     - cp -r C:/subprojects/* subprojects/
458
459     - $env:PATH += ";C:\msys64\usr\bin;C:\msys64\mingw64/bin;C:\msys64\mingw32/bin"
460     # For some reason, options are separated by newline instead of space, so we
461     # have to replace them first.
462     - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
463     - C:\msys64\usr\bin\bash -c "cd $env:CI_PROJECT_DIR/gst-build &&
464         python git-update --no-interaction --manifest=$env:CI_PROJECT_DIR/manifest.xml &&
465         meson build $env:MESON_ARGS &&
466         ninja -C build"
467
468
469 # Template for Cerbero GStreamer Deps
470 #
471 # This template is used by cerbero/ project to pre-built the GStreamer
472 # dependencies. When available, the .cerbero jobs will download this artifact
473 # in order to speed up the build.
474 #
475 # Parameters:
476 # CONFIG: The name of the configuration file to use
477 # ARCH: The cerbero <os>_<cpu> (used in cache key)
478 #
479 # Produce an artifact with the dist/ and .cache along
480 # with the associated build-tools.
481 .cerbero deps:
482   extends: .cerbero
483   stage: "pre-build"
484   script:
485     - $CERBERO $CERBERO_ARGS show-config
486     - $CERBERO $CERBERO_ARGS fetch-bootstrap --build-tools-only
487     - $CERBERO $CERBERO_ARGS fetch-package --deps gstreamer-1.0
488     - $CERBERO $CERBERO_ARGS bootstrap --offline --build-tools-only
489     - $CERBERO $CERBERO_ARGS build-deps --offline
490           gstreamer-1.0 gst-plugins-base-1.0 gst-plugins-good-1.0
491           gst-plugins-bad-1.0 gst-plugins-ugly-1.0 gst-rtsp-server-1.0
492           gst-libav-1.0 gst-validate gst-editing-services-1.0 libnice
493     - $CERBERO $CERBERO_ARGS fetch-cache --branch ${GST_UPSTREAM_BRANCH} --skip-fetch --job-id=${CI_JOB_ID}
494     - test "x${CERBERO_OVERRIDDEN_DIST_DIR}" != "x"
495           && mkdir -p ${CERBERO_HOME}/dist/${ARCH}
496           && rsync -aH ${CERBERO_OVERRIDDEN_DIST_DIR}/ ${CERBERO_HOME}/dist/${ARCH}
497     - tar -C ${CERBERO_HOME} -czf $CERBERO_DEPS
498               build-tools build-tools.cache
499               dist/${ARCH} ${ARCH}.cache
500   only:
501     variables:
502       - $CI_PROJECT_NAME == "cerbero"
503   artifacts:
504     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
505     expire_in: '10 days'
506     when: 'always'
507     paths:
508       - "manifest.xml"
509       - "${CERBERO_HOME}/logs"
510       - "${CERBERO_HOME}/cerbero-deps.log"
511       - "${CERBERO_DEPS}"
512
513 #
514 # Cerbero Linux X86_64 build
515 #
516 cerbero deps fedora x86_64:
517   extends: '.cerbero deps'
518   variables:
519     CONFIG: "linux.config"
520     ARCH: "linux_x86_64"
521
522 .cerbero fedora x86_64:
523   extends: '.cerbero'
524   variables:
525     CONFIG: "linux.config"
526
527 cerbero fedora x86_64:
528   extends: '.cerbero fedora x86_64'
529   needs:
530     - "cerbero deps fedora x86_64"
531     - "manifest"
532   dependencies:
533     - "cerbero deps fedora x86_64"
534   only:
535     variables:
536       - $CI_PROJECT_NAME == "cerbero"
537
538 build cerbero fedora x86_64:
539   extends: '.cerbero fedora x86_64'
540   except:
541     variables:
542       - $CI_PROJECT_NAME == "cerbero"
543       - $CI_PROJECT_NAME == "gst-build"
544       - $CI_PROJECT_NAME == "gst-omx"
545       - $CI_PROJECT_NAME == "gstreamer-vaapi"
546       - $CI_PROJECT_NAME == "gst-docs"
547
548 #
549 # Cerbero Android Universal build
550 #
551 cerbero deps cross-android universal:
552   extends: '.cerbero deps'
553   variables:
554     CONFIG: "cross-android-universal.cbc"
555     ARCH: "android_universal"
556
557 .cerbero cross-android universal:
558   extends: '.cerbero'
559   variables:
560     CONFIG: "cross-android-universal.cbc"
561
562 cerbero cross-android universal:
563   extends: '.cerbero cross-android universal'
564   needs:
565     - "cerbero deps cross-android universal"
566     - "manifest"
567   dependencies:
568     - "cerbero deps cross-android universal"
569   only:
570     variables:
571       - $CI_PROJECT_NAME == "cerbero"
572
573 build cerbero cross-android universal:
574   extends: '.cerbero cross-android universal'
575   except:
576     variables:
577       - $CI_PROJECT_NAME == "cerbero"
578       - $CI_PROJECT_NAME == "gst-build"
579       - $CI_PROJECT_NAME == "gst-omx"
580       - $CI_PROJECT_NAME == "gstreamer-vaapi"
581       - $CI_PROJECT_NAME == "gst-docs"
582
583 #
584 # Cerbero Cross Windows builds
585 #
586 cerbero deps cross-windows x86:
587   extends: '.cerbero deps'
588   variables:
589     CONFIG: "cross-win32.cbc"
590     ARCH: "windows_x86"
591
592 .cerbero cross win32:
593   extends: '.cerbero'
594   variables:
595     CONFIG: "cross-win32.cbc"
596
597 cerbero cross win32:
598   extends: '.cerbero cross win32'
599   needs:
600     - "cerbero deps cross-windows x86"
601     - "manifest"
602   dependencies:
603     - "cerbero deps cross-windows x86"
604   only:
605     variables:
606       - $CI_PROJECT_NAME == "cerbero"
607
608 build cerbero cross win32:
609   extends: '.cerbero cross win32'
610   except:
611     variables:
612       - $CI_PROJECT_NAME == "cerbero"
613       - $CI_PROJECT_NAME == "gst-build"
614       - $CI_PROJECT_NAME == "gst-omx"
615       - $CI_PROJECT_NAME == "gstreamer-vaapi"
616       - $CI_PROJECT_NAME == "gst-docs"
617
618 cerbero deps cross-windows x86_64:
619   extends: '.cerbero deps'
620   variables:
621     CONFIG: "cross-win64.cbc"
622     ARCH: "windows_x86_64"
623
624 .cerbero cross win64:
625   extends: '.cerbero'
626   variables:
627     CONFIG: "cross-win64.cbc"
628
629 cerbero cross win64:
630   extends: '.cerbero cross win64'
631   needs:
632     - "cerbero deps cross-windows x86_64"
633     - "manifest"
634   dependencies:
635     - "cerbero deps cross-windows x86_64"
636   only:
637     variables:
638       - $CI_PROJECT_NAME == "cerbero"
639
640 build cerbero cross win64:
641   extends: '.cerbero cross win64'
642   except:
643     variables:
644       - $CI_PROJECT_NAME == "cerbero"
645       - $CI_PROJECT_NAME == "gst-build"
646       - $CI_PROJECT_NAME == "gst-omx"
647       - $CI_PROJECT_NAME == "gstreamer-vaapi"
648       - $CI_PROJECT_NAME == "gst-docs"
649
650 #
651 # Build an Android App using the android binaries
652 #
653 .cross-android universal examples:
654   image: $ANDROID_IMAGE
655   extends:
656     - '.global_retry_policy'
657   stage: 'integrate'
658   variables:
659     EXAMPLES_HOME: ${CI_PROJECT_DIR}/examples
660     GSTREAMER_ROOT_ANDROID: ${CI_PROJECT_DIR}/examples/cerbero-android-universal
661   script:
662     - mkdir -p ${EXAMPLES_HOME}/outputs
663     - curl -o clone_manifest_ref.py https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/clone_manifest_ref.py
664     - chmod +x clone_manifest_ref.py
665     - ./clone_manifest_ref.py --manifest manifest.xml --project gst-examples --destination ${EXAMPLES_HOME}/gst-examples
666     - ./clone_manifest_ref.py --manifest manifest.xml --project gst-docs --destination ${EXAMPLES_HOME}/gst-docs
667     - rm clone_manifest_ref.py
668
669     # extract our binaries
670     - rm -f gstreamer-1.0-android-universal-*-runtime.tar.bz2
671     - mkdir ${GSTREAMER_ROOT_ANDROID}
672     - tar -C ${GSTREAMER_ROOT_ANDROID} -xf gstreamer-1.0-android-universal-*.tar.bz2
673
674     # gst-examples
675     - chmod +x ${EXAMPLES_HOME}/gst-examples/playback/player/android/gradlew
676     - ${EXAMPLES_HOME}/gst-examples/playback/player/android/gradlew --no-search-upward --no-daemon --project-dir ${EXAMPLES_HOME}/gst-examples/playback/player/android assembleDebug
677     - cp ${EXAMPLES_HOME}/gst-examples/playback/player/android/app/build/outputs/apk/debug/*.apk ${EXAMPLES_HOME}/outputs/
678
679     # gst-docs android tutorials
680     - chmod +x ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android/gradlew
681     - ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android/gradlew --no-search-upward --no-daemon --project-dir ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android assembleDebug
682     - cp ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android/android-tutorial-*/build/outputs/apk/debug/*.apk ${EXAMPLES_HOME}/outputs/
683   after_script:
684     - rm -rf ${GSTREAMER_ROOT_ANDROID}
685     - rm -rf ${EXAMPLES_HOME}/gst-examples ${EXAMPLES_HOME}/gst-docs
686   artifacts:
687     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
688     expire_in: '5 days'
689     when: 'always'
690     paths:
691       - "manifest.xml"
692       - "${EXAMPLES_HOME}/outputs"
693
694 cross-android universal examples:
695   extends: ".cross-android universal examples"
696   needs:
697     - "build cerbero cross-android universal"
698     - "manifest"
699   dependencies:
700     - "build cerbero cross-android universal"
701   except:
702     variables:
703       - $CI_PROJECT_NAME == "cerbero"
704       - $CI_PROJECT_NAME == "gst-build"
705       - $CI_PROJECT_NAME == "gst-omx"
706       - $CI_PROJECT_NAME == "gst-integration-testsuites"
707       - $CI_PROJECT_NAME == "gstreamer-vaapi"
708       - $CI_PROJECT_NAME == "gst-docs"
709
710 cerbero cross-android universal examples:
711   extends: ".cross-android universal examples"
712   needs:
713     - "cerbero cross-android universal"
714     - "manifest"
715   dependencies:
716     - "cerbero cross-android universal"
717   only:
718     variables:
719       - $CI_PROJECT_NAME == "cerbero"
720
721 #
722 # Cerbero macOS X86_64 build
723 #
724 cerbero deps macos x86_64:
725   extends: '.cerbero deps'
726   variables:
727     ARCH: "darwin_x86_64"
728     CONFIG: "osx-x86-64.cbc"
729     HAVE_CCACHE: ""
730     CERBERO_OVERRIDDEN_DIST_DIR: "/Library/Frameworks/GStreamer.framework/Versions/1.0"
731   tags:
732     - gst-macos-10.14
733
734 .cerbero macos x86_64:
735   extends: '.cerbero'
736   variables:
737     ARCH: "darwin_x86_64"
738     CONFIG: "osx-x86-64.cbc"
739     CERBERO_PACKAGE_ARGS: ""
740     HAVE_CCACHE: ""
741     CERBERO_OVERRIDDEN_DIST_DIR: "/Library/Frameworks/GStreamer.framework/Versions/1.0"
742   tags:
743     - gst-macos-10.14
744   artifacts:
745     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
746     expire_in: '5 days'
747     when: 'always'
748     paths:
749       - "manifest.xml"
750       - "${CERBERO_HOME}/logs"
751       - "gstreamer-1.0-1.*.pkg"
752       - "gstreamer-1.0-devel-1.*.pkg"
753
754 cerbero macos x86_64:
755   extends: '.cerbero macos x86_64'
756   needs:
757     - "cerbero deps macos x86_64"
758     - "manifest"
759   dependencies:
760     - "cerbero deps macos x86_64"
761   only:
762     variables:
763       - $CI_PROJECT_NAME == "cerbero"
764
765 build cerbero macos x86_64:
766   extends: '.cerbero macos x86_64'
767   except:
768     variables:
769       - $CI_PROJECT_NAME == "cerbero"
770       - $CI_PROJECT_NAME == "gst-build"
771       - $CI_PROJECT_NAME == "gst-integration-testsuite"
772       - $CI_PROJECT_NAME == "gst-omx"
773       - $CI_PROJECT_NAME == "gstreamer-vaapi"
774       - $CI_PROJECT_NAME == "gst-docs"
775       - $CI_PROJECT_NAME == "gst-sharp"
776
777 #
778 # Cerbero iOS build
779 #
780 cerbero deps cross-ios universal:
781   extends: '.cerbero deps'
782   variables:
783     ARCH: "ios_universal"
784     CONFIG: "cross-ios-universal.cbc"
785     CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS} -v nowerror"
786     HAVE_CCACHE: ""
787   tags:
788     - gst-ios-12.2
789
790 .cerbero cross-ios universal:
791   extends: '.cerbero'
792   variables:
793     ARCH: "ios_universal"
794     CONFIG: "cross-ios-universal.cbc"
795     CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS} -v nowerror"
796     CERBERO_PACKAGE_ARGS: ""
797     HAVE_CCACHE: ""
798   tags:
799     - gst-ios-12.2
800   artifacts:
801     name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
802     expire_in: '5 days'
803     when: 'always'
804     paths:
805       - "manifest.xml"
806       - "${CERBERO_HOME}/logs"
807       - "gstreamer-1.0-*-ios-universal.pkg"
808
809 cerbero cross-ios universal:
810   extends: '.cerbero cross-ios universal'
811   needs:
812     - "cerbero deps cross-ios universal"
813     - "manifest"
814   dependencies:
815     - "cerbero deps cross-ios universal"
816   only:
817     variables:
818       - $CI_PROJECT_NAME == "cerbero"
819
820 build cerbero cross-ios universal:
821   extends: '.cerbero cross-ios universal'
822   when: 'manual'
823   except:
824     variables:
825       - $CI_PROJECT_NAME == "cerbero"
826       - $CI_PROJECT_NAME == "gst-build"
827       - $CI_PROJECT_NAME == "gst-integration-testsuite"
828       - $CI_PROJECT_NAME == "gst-omx"
829       - $CI_PROJECT_NAME == "gstreamer-vaapi"
830       - $CI_PROJECT_NAME == "gst-docs"
831       - $CI_PROJECT_NAME == "gst-sharp"
832
833 documentation:
834   image: $FEDORA_IMAGE
835   extends:
836     - '.global_retry_policy'
837   needs:
838     - "build fedora x86_64"
839     - "manifest"
840   dependencies:
841     - 'build fedora x86_64'
842   stage: integrate
843
844   script:
845   - pip3 install --upgrade git+https://github.com/hotdoc/hotdoc.git
846   - cd gst-build/
847   - ./gst-uninstalled.py hotdoc run --conf-file=build/subprojects/gst-docs/GStreamer-doc.json --fatal-warnings
848   - cd -
849   - mv gst-build/build/subprojects/gst-docs/GStreamer-doc/html documentation/
850
851   artifacts:
852     paths:
853     - documentation/
854   except:
855     variables:
856       - $CI_PROJECT_NAME == "cerbero"
857       - $CI_PROJECT_NAME == "gst-integration-testsuite"
858       - $CI_PROJECT_NAME == "gst-python"
859       - $CI_PROJECT_NAME == "gst-sharp"
860       - $CI_PROJECT_NAME == "gst-build"
861
862 #
863 # Build an iOS App using the iOS binaries
864 #
865 .cross-ios universal examples:
866   stage: 'integrate'
867   extends:
868     - '.global_retry_policy'
869   variables:
870     EXAMPLES_HOME: ${CI_PROJECT_DIR}/examples
871     # disable codesigning so we don't need developer identities on the CI
872     # machines
873     XCODE_BUILD_ARGS: >
874       CODE_SIGNING_REQUIRED="NO"
875       CODE_SIGN_IDENTITY=""
876       CODE_SIGNING_ALLOWED="NO"
877       CODE_SIGN_ENTITLEMENTS=""
878   script:
879     # install the binaries
880     - installer -pkg gstreamer-1.0-devel-*-ios-universal.pkg -target CurrentUserHomeDirectory -verbose
881
882     - curl -o clone_manifest_ref.py https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/clone_manifest_ref.py
883     - chmod +x clone_manifest_ref.py
884     - ./clone_manifest_ref.py --manifest manifest.xml --project gst-examples --destination ${EXAMPLES_HOME}/gst-examples
885     - ./clone_manifest_ref.py --manifest manifest.xml --project gst-docs --destination ${EXAMPLES_HOME}/gst-docs
886     - rm clone_manifest_ref.py
887
888     # dump some useful information
889     - xcodebuild -version
890     - xcodebuild -showsdks
891
892     # gst-docs ios tutorials
893     - xcodebuild -showBuildSettings -alltargets -project ${EXAMPLES_HOME}/gst-docs/examples/tutorials/xcode\ iOS/GStreamer\ iOS\ Tutorials.xcodeproj
894     - xcodebuild -alltargets -destination generic/platform=iOS -project ${EXAMPLES_HOME}/gst-docs/examples/tutorials/xcode\ iOS/GStreamer\ iOS\ Tutorials.xcodeproj ${XCODE_BUILD_ARGS}
895
896     # gst-examples
897     - xcodebuild -showBuildSettings -alltargets -project ${EXAMPLES_HOME}/gst-examples/playback/player/ios/GstPlay.xcodeproj
898     - xcodebuild -alltargets -destination generic/platform=iOS -project ${EXAMPLES_HOME}/gst-examples/playback/player/ios/GstPlay.xcodeproj ${XCODE_BUILD_ARGS}
899   after_script:
900     - rm -rf ${EXAMPLES_HOME}/gst-examples ${EXAMPLES_HOME}/gst-docs
901   tags:
902     - gst-ios-12.2
903
904 cross-ios universal examples:
905   extends: ".cross-ios universal examples"
906   when: 'manual'
907   dependencies:
908     - "build cerbero cross-ios universal"
909   except:
910     variables:
911       - $CI_PROJECT_NAME == "cerbero"
912       - $CI_PROJECT_NAME == "gst-build"
913       - $CI_PROJECT_NAME == "gst-omx"
914       - $CI_PROJECT_NAME == "gst-integration-testsuites"
915       - $CI_PROJECT_NAME == "gstreamer-vaapi"
916
917 cerbero cross-ios universal examples:
918   extends: ".cross-ios universal examples"
919   needs:
920     - "cerbero cross-ios universal"
921     - "manifest"
922   dependencies:
923     - "cerbero cross-ios universal"
924   only:
925     variables:
926       - $CI_PROJECT_NAME == "cerbero"