ci_template.yml 42 KB
Newer Older
1
2
3
include:
  - template: 'Workflows/Branch-Pipelines.gitlab-ci.yml'

4
stages:
5
  - 'build docker'
6
  - 'preparation'
Matthew Waters's avatar
Matthew Waters committed
7
  - 'pre-build'
8
9
  - 'build'
  - 'test'
Matthew Waters's avatar
Matthew Waters committed
10
11
  # Use the resulting binaries
  - 'integrate'
12
13

variables:
14
15
16
  # Branch to track for modules that have no ref specified in the manifest
  GST_UPSTREAM_BRANCH: 'master'
  ORC_UPSTREAM_BRANCH: 'master'
17
18
19
20
21
22
23

  ###
  # IMPORTANT
  # These are the version tags for the docker images the CI runs against.
  # If you are hacking on them or need a them to rebuild, its enough
  # to change any part of the string of the image you want.
  ###
24
  FEDORA_TAG:  '2020-09-15.0'
25
26
  CERBERO_TAG: '2020-09-09.2'
  ANDROID_TAG: '2020-09-09.2'
27
28
  MANIFEST_TAG: '2020-06-25.0'
  TEST_MANIFEST_TAG: '2020-06-25.0'
29
  INDENT_TAG: '2020-06-29.0'
30
31
32
33
34
35
36
37

  GST_UPSTREAM_REPO: 'gstreamer/gst-ci'

  FEDORA_AMD64_SUFFIX:  'amd64/fedora'
  CERBERO_AMD64_SUFFIX: 'amd64/cerbero-fedora'
  ANDROID_AMD64_SUFFIX: 'amd64/android-fedora'
  MANIFEST_AMD64_SUFFIX: 'amd64/build-manifest'
  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
43
44
45
  CERBERO_IMAGE:  "$CI_REGISTRY_IMAGE/$CERBERO_AMD64_SUFFIX:$CERBERO_TAG-$GST_UPSTREAM_BRANCH"
  ANDROID_IMAGE:  "$CI_REGISTRY_IMAGE/$ANDROID_AMD64_SUFFIX:$ANDROID_TAG-$GST_UPSTREAM_BRANCH"
  MANIFEST_IMAGE: "$CI_REGISTRY_IMAGE/$MANIFEST_AMD64_SUFFIX:$MANIFEST_TAG-$GST_UPSTREAM_BRANCH"
  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:v13-master'
49

50
  # Can't use $CI_* variables since we use this template in all repos, not just gst-ci
51
  CERBERO_SCRIPT_URL: "https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/cerbero_setup.sh"
52

53
  GIT_STRATEGY: none
54
  MESON_BUILDTYPE_ARGS: --default-library=both
Xavier Claessens's avatar
Xavier Claessens committed
55
  DEFAULT_MESON_ARGS: >
56
57
58
59
    -Dlibnice:tests=disabled
    -Dlibnice:examples=disabled
    -Dopenh264:tests=disabled
    -Dpygobject:tests=false
Xavier Claessens's avatar
Xavier Claessens committed
60
61
62
63
64
65
66
67
68
    -Dpython=enabled
    -Dlibav=enabled
    -Dugly=enabled
    -Dbad=enabled
    -Ddevtools=enabled
    -Dges=enabled
    -Drtsp_server=enabled
    -Dvaapi=enabled
    -Dsharp=disabled
69

70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
  MESON_GST_WERROR: >
    -Dgstreamer:werror=true
    -Dgst-plugins-base:werror=true
    -Dgst-plugins-good:werror=true
    -Dgst-plugins-ugly:werror=true
    -Dgst-plugins-bad:werror=true
    -Dgst-rtsp-server:werror=true
    -Dgst-libav:werror=true
    -Dgst-examples:werror=true
    -Dgst-editing-services:werror=true
    -Dgst-docs:werror=true
    -Dgst-omx:werror=true
    -Dgst-devtools:werror=true
    -Dgst-python:werror=true
    -Dgstreamer-vaapi:werror=true
    -Dgstreamer-sharp:werror=true

87
  DEFAULT_CERBERO_ARGS: >
88
89
    --variants werror
    --timestamps
90

91
92
93
#
# Global CI policy
#
Nicolas Dufresne's avatar
Nicolas Dufresne committed
94
# This can be used to configure global behaviour our our jobs.
95
#
96
default:
97
98
99
100
  retry:
    max: 2
    when:
      - 'runner_system_failure'
101
102
      - 'stuck_or_timeout_failure'
      - 'scheduler_failure'
103
      - 'api_failure'
104
  interruptible: true
105

106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124

# Script to check if a docker image exists in the upstream registry
# and if so copy it to the forked registry so we can use it
#
# This is copied/adapted from citemplates/templates/fedora.yml
# https://gitlab.freedesktop.org/freedesktop/ci-templates/-/blob/96b621fe9f57ec2464f8d1a0940446afbf6c8f59/templates/fedora.yml
.check_image: &check_image_exists |
  # if-not-exists steps
  set -x

  if [[ -z "$GST_FORCE_REBUILD" ]]
  then
    # disable exit on failure
    set +e

    # check if our image is already in the current registry
    # we store the sha of the digest and the layers
    skopeo inspect docker://$LOCAL_IMAGE | jq '[.Digest, .Layers]' > local_sha

125
126
127
    # check if our image is already in our gst-ci registry fork
    skopeo inspect docker://$LOCAL_GST_CI_IMAGE | jq '[.Digest, .Layers]' > local_gst_ci_sha

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
    # check if our image is already in the upstream registry
    if [[ -z "$GST_UPSTREAM_REPO" ]]
    then
      echo "WARNING! Variable \$GST_UPSTREAM_REPO is undefined, cannot check for images"
    else
      skopeo inspect docker://$GST_UPSTREAM_IMAGE | jq '[.Digest, .Layers]' > upstream_sha
    fi

    # reenable exit on failure
    set -e

    # if the upstream repo has an image, ensure we use the same
    if [ -s upstream_sha ]
    then

143
      echo "Checking if $LOCAL_IMAGE is up to date"
144
145
146
      # ensure we use the same image from upstream
      diff upstream_sha local_sha && exit 0 || true

147
      echo "Copying image from gstreamer/gst-ci to local registry"
148
149
150
151
152
153
154
155
156
157
158
159
      # copy the original image into the current project registry namespace
      # we do 2 attempts with skopeo copy at most
      skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
                  docker://$GST_UPSTREAM_IMAGE \
                  docker://$LOCAL_IMAGE || \
      skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
                  docker://$GST_UPSTREAM_IMAGE \
                  docker://$LOCAL_IMAGE

      exit 0
    fi

160
161
    set +x

162
163
164
    # if the local ci fork repo has an image, ensure we use the same
    if [ -s local_gst_ci_sha ]
    then
165
      echo "Checking if $LOCAL_GST_CI_IMAGE is up to date"
166
167
168
      # ensure we use the same image from upstream
      diff local_gst_ci_sha local_sha && exit 0 || true

169
      echo "Copying image from $CI_PROJECT_NAMESPACE/gst-ci to local registry"
170
171
172
173
174
175
176
177
178
179
180
181
      # copy the original image into the current project registry namespace
      # we do 2 attempts with skopeo copy at most
      skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
                  docker://$LOCAL_GST_CI_IMAGE \
                  docker://$LOCAL_IMAGE || \
      skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
                  docker://$LOCAL_GST_CI_IMAGE \
                  docker://$LOCAL_IMAGE

      exit 0
    fi

182
183
184
    # if we have a local image but none in the upstream repo, use our
    if [ -s local_sha ]
    then
185
      echo "Using $LOCAL_IMAGE"
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
      exit 0
    fi
  fi


# Build docker images from Dockerfiles
#
# This is copied/adapted from citemplates/templates/fedora.yml
# https://gitlab.freedesktop.org/freedesktop/ci-templates/-/blob/96b621fe9f57ec2464f8d1a0940446afbf6c8f59/templates/fedora.yml
#
# CITemplates builds uses buildah run/commit workflow to build the images which doesn't
# fit us atm and our images need further adjustment to make use of it. Porting to
# ci-templates is the next step though.
#
# All the documentation from citemplates should be applicable here, so please refer there
.base:
202
  image: "$CI_REGISTRY/freedesktop/ci-templates/buildah:2020-07-20.1"
203
204
205
206
207
208
209
210
  variables:
    STORAGE_DRIVER: 'vfs'
    BUILDAH_FORMAT: 'docker'
    BUILDAH_ISOLATION: 'chroot'

    GIT_STRATEGY: fetch
  script:
    - export LOCAL_IMAGE="$CI_REGISTRY_IMAGE/$REPO_SUFFIX:$TAG"
211
    - export LOCAL_GST_CI_IMAGE="$CI_REGISTRY/$CI_PROJECT_NAMESPACE/gst-ci/$REPO_SUFFIX:$TAG"
212
213
    - export GST_UPSTREAM_IMAGE="$CI_REGISTRY/$GST_UPSTREAM_REPO/$REPO_SUFFIX:$TAG"

214
215
216
217
218
219
220
221
222
223
    # check if the docker registry is enabled, else the variable will be missing
    - |
      if [[ -z "$CI_REGISTRY_IMAGE" ]]
      then
        echo "ERROR! Looks like your repository/fork has disabled Docker Registries."
        echo "Pleae enable them by following the documentation from here:"
        echo "https://docs.gitlab.com/ee/user/packages/container_registry/#enable-the-container-registry-for-your-project"
        exit 1
      fi

224
225
226
227
    # Newer versions of podman/buildah try to set overlayfs mount options when
    # using the vfs driver, and this causes errors.
    - sed -i '/^mountopt =.*/d' /etc/containers/storage.conf

228
    - *check_image_exists
229

230
231
232
233
234
235
236
237
238
    # This part of the job should only ever be possible to be reach in a gst-ci fork
    - |
      if [[ "$CI_PROJECT_NAME" != 'gst-ci' ]]
      then
        echo "ERROR! Something is wrong!"
        echo "This part of the job is supposed to be executed only in gst-ci forks, and its probably going to fail else"
        exit 1
      fi

239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
    - echo "Building image $LOCAL_IMAGE"

    - >
      buildah bud
      --build-arg DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH
      --label ci.job_id=$CI_JOB_ID
      --label pipeline.url=$CI_PIPELINE_URL
      --label git.ref_name=$CI_COMMIT_REF_NAME
      --label git.sha=$CI_COMMIT_SHA
      --label gitlab.project_path=$CI_PROJECT_PATH
      --label gitlab.project_url=$CI_PROJECT_URL
      --label fdo.upstream-repo=$GST_UPSTREAM_REPO
      --label fdo.expires-after="3w"
      -f $DOCKERFILE
      -t $LOCAL_IMAGE
      $CONTEXT_DIR

    - buildah login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY

    # Sanity check
    - |
      if [ "$CI_PROJECT_PATH" = "gstreamer/gst-ci" ]; then
        if [ "$LOCAL_IMAGE" != "$GST_UPSTREAM_IMAGE" ]; then
          echo "ERROR!!! AAAAA! THE IMAGE URI DOES NOT MATCH THE EXPECTED UPSTREAM ONE"
          echo $LOCAL_IMAGE
          echo $GST_UPSTREAM_IMAGE
          exit 1
        fi
      fi

    -  buildah push $LOCAL_IMAGE

fedora amd64 docker:
  stage: "build docker"
  variables:
    REPO_SUFFIX: "$FEDORA_AMD64_SUFFIX"
    TAG: "$FEDORA_TAG-$GST_UPSTREAM_BRANCH"

    CONTEXT_DIR: "./docker/fedora/"
    DOCKERFILE: "docker/fedora/Dockerfile"
  extends: .base

cerbero fedora amd64 docker:
  stage: "build docker"
  variables:
    REPO_SUFFIX: "$CERBERO_AMD64_SUFFIX"
    TAG: "$CERBERO_TAG-$GST_UPSTREAM_BRANCH"

    CONTEXT_DIR: "docker/cerbero/"
    DOCKERFILE: "docker/cerbero/Dockerfile-fedora"
  extends: .base

android docker:
  stage: "build docker"
  variables:
    REPO_SUFFIX: "$ANDROID_AMD64_SUFFIX"
    TAG: "$ANDROID_TAG-$GST_UPSTREAM_BRANCH"

    CONTEXT_DIR: "docker/android/"
    DOCKERFILE: "docker/android/Dockerfile"
  extends: .base

alpine amd64 manifest builder docker:
  stage: "build docker"
  variables:
    REPO_SUFFIX: "$MANIFEST_AMD64_SUFFIX"
    TAG: '$MANIFEST_TAG-$GST_UPSTREAM_BRANCH'

    CONTEXT_DIR: "docker/build_manifest/"
    DOCKERFILE: "docker/build_manifest/Dockerfile"
  extends: .base

gst-indent amd64 docker:
  stage: "build docker"
  variables:
    REPO_SUFFIX: "$INDENT_AMD64_SUFFIX"
315
    TAG: "$INDENT_TAG-$GST_UPSTREAM_BRANCH"
316
317
318
319
320
321
322
323

    CONTEXT_DIR: "docker/indent/"
    DOCKERFILE: "docker/indent/Dockerfile"
  extends: .base

#
# Job to create the manifest.xml to used for our builds
#
324
manifest:
325
  image: $MANIFEST_IMAGE
326
  rules:
327
328
    # Always have automatic pipeline for branchs in cerbero and docs
    # cause they need to update artifacts, like the docs site or cerbero deps
329
    - if: '$CI_PROJECT_PATH == "gstreamer/cerbero"'
330
    - if: '$CI_PROJECT_PATH == "gstreamer/gst-docs"'
331
332
333

    # If the user that triggered the Pipeline is the Merge bot and the branch doesn't match
    # the upstream branch set, run the pipeline
334
    - if: '$GITLAB_USER_LOGIN == "gstreamer-merge-bot" && $CI_COMMIT_BRANCH != $GST_UPSTREAM_BRANCH'
335
336
337
338
339
340
    # When the user isn't the merge bot, require an explicit action to trigger the pipeline
    # to avoid wasting CI resources
    - if: '$GITLAB_USER_LOGIN != "gstreamer-merge-bot"'
      when: 'manual'
    # If this matches, it means the pipeline is running against either the main
    # or a stable branch, so make it manual
341
    - if: '$CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
342
343
      when: 'manual'

344
  stage: 'preparation'
345
  script:
346
347
348
349
    - cd /gst-ci
    - gitlab/build_manifest.py --self-update
    - gitlab/build_manifest.py ${CI_PROJECT_DIR}/manifest.xml
    - cat ${CI_PROJECT_DIR}/manifest.xml
350
  artifacts:
351
    expire_in: "7 days"
352
353
354
    paths:
      - "manifest.xml"

355
356
357
#
# gst-indent!!
#
358
gst indent:
359
  image: $INDENT_IMAGE
360
361
362
  stage: 'preparation'
  variables:
    GIT_STRATEGY: 'fetch'
Nicolas Dufresne's avatar
Nicolas Dufresne committed
363
364
  rules:
    - if: '$CI_PROJECT_NAME !~ /^(gstreamer-sharp|gst-integration-testsuites|cerbero|gst-docs)$/'
365
366
367
  script:
    # man indent. grep RETURN VALUE, grab a beer on my behalf...
    - indent --version || true
368
    - |
369
      filter_cmd=("cat")
370
      if test -f ".indentignore"; then
371
          filter_args=()
372
373
          while read -r line; do
              if test -n "$line"; then
374
                  filter_args+=("-e" "$line")
375
376
              fi
          done < ".indentignore"
377
378
          if [[ ${#filter_args[@]} -gt 0 ]]; then
              filter_cmd=("grep" "-v" "${filter_args[@]}")
379
380
          fi
      fi
381
      find . -name '*.c' | "${filter_cmd[@]}" | xargs -d '\n' gst-indent
382
    - |
383
384
385
      if git diff --quiet; then
          echo "Code is properly formatted"
      else
386
387
388
389
390
          git diff --color=always
          echo 'style diverges, please run gst-indent first'
          exit 1
      fi

391
392
393
#
# gst-build setup templates
#
394
395
.gst_build_template: &gst_build
  - echo $MESON_ARGS
396
397
398
399
400
401
  # Sometimes, gitlab-runner want to reuse
  # existing docker volumes without cleaning them up...
  # Make sure the docker volume is clean
  - rm -rf gst-build || true
  - rm -rf meson-logs || true
  - rm -rf validate-logs || true
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427

  - curl -L -o clone_manifest_ref.py "https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/clone_manifest_ref.py"
  - python3 clone_manifest_ref.py --manifest manifest.xml --project gst-build --destination gst-build
  - cd gst-build/
  # only copy immediate directories. We don't want to modify .wrap files
  - find /gst-build/subprojects/ -mindepth 1 -maxdepth 1 -type d -exec cp -r \{\} subprojects/ \;
  - ./git-update --no-interaction --manifest="${CI_PROJECT_DIR}/manifest.xml"
  - meson build/ $MESON_ARGS
  - ninja -C build/
  - ccache --show-stats

.gst_build_ccache_vars:
  variables:
    CCACHE_COMPILERCHECK: 'content'
    CCACHE_COMPRESS: 'true'
    CCACHE_BASEDIR: '/cache/gstreamer/gst-build'
    CCACHE_DIR: '/cache/gstreamer/gst-build/ccache/'
    # shared across everything really
    CCACHE_MAXSIZE: '10G'
    CARGO_HOME: '/cache/gstreamer/cargo'

.simple_fedora_build: &simple_build >-
  ${DEFAULT_MESON_ARGS}
  -Dsharp=enabled
  -Domx=enabled
  -Dgst-omx:target=generic
428
  -Ddoc=disabled
429
430
  -Drs=disabled
  ${MESON_BUILDTYPE_ARGS}
431
  ${MESON_GST_WERROR}
432

433
.build:
Matthew Waters's avatar
Matthew Waters committed
434
  stage: 'build'
435
  extends:
436
    - '.gst_build_ccache_vars'
437
438
  needs:
    - "manifest"
439
  # Taking into account the slowest shared runner + time needed to upload the binaries to artifacts
440
441
  # Also need to take into account I/O of pulling docker images and uploading artifacts
  timeout: '45min'
442
  variables:
443
    MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
444
445
  rules:
    - if: '$CI_PROJECT_NAME != "cerbero"'
446
  script:
447
    *gst_build
448
  after_script:
449
450
451
452
    - mv gst-build/build/meson-logs/ meson-logs
    # Cleanup everything else to reduce the size
    # of the docker volume we leave behind
    - rm -rf gst-build
453
454
455
456
  artifacts:
    expire_in: "7 days"
    when: "always"
    paths:
457
      - 'meson-logs/'
458
      - 'manifest.xml'
459

460
.build fedora x86_64:
461
  extends: '.build'
462
  image: $FEDORA_IMAGE
Thibault Saunier's avatar
Thibault Saunier committed
463
  variables:
464
    MESON_ARGS: *simple_build
Nicolas Dufresne's avatar
Nicolas Dufresne committed
465
466
  rules:
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-omx|gst-plugins-rs)$/'
467

468
build nodebug fedora x86_64:
469
  extends: '.build'
Thibault Saunier's avatar
Thibault Saunier committed
470
  image: $FEDORA_IMAGE
471
  variables:
472
    MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
473
474
  rules:
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
475
476

build static fedora x86_64:
477
  extends: '.build fedora x86_64'
478
479
  variables:
    MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
480
481
  rules:
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
482
483
484
485
486

build static nodebug fedora x86_64:
  extends: 'build nodebug fedora x86_64'
  variables:
    MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
487
488
  rules:
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
489

490
build clang fedora x86_64:
491
  extends: '.build fedora x86_64'
492
493
494
  variables:
    CC: 'ccache clang'
    CXX: 'ccache clang++'
Nicolas Dufresne's avatar
Nicolas Dufresne committed
495
496
  rules:
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
497

498
499
.test:
  stage: 'test'
500
  extends:
501
502
503
    - '.gst_build_ccache_vars'
  needs:
    - "manifest"
504
  variables:
505
506
    MESON_ARGS: *simple_build

507
    # Disable colored output to avoid weird rendering issues
508
509
510
    GST_DEBUG_NO_COLOR: "true"
    CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/validate-logs/"
    GST_VALIDATE_LAUNCHER_FORCE_COLORS: "true"
511
    TIMEOUT_FACTOR: "2"
512
    CARGO_HOME: "/cache/gstreamer/cargo"
513
514
515
    # Enable the fault handler so we get backtraces on segfaults.
    # any non-empty string will do
    PYTHONFAULTHANDLER: "enabled"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
516
517
  rules:
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-examples|gst-docs)$/'
518
  script:
519
520
    - *gst_build

521
    - echo "-> Running ${TEST_SUITE}"
522
523
524
    - >
      ./gst-uninstalled.py
      gst-validate-launcher ${TEST_SUITE}
525
      --dump-on-failure
526
527
528
529
      --mute
      --shuffle
      --no-display
      --meson-no-rebuild
530
      --timeout-factor "${TIMEOUT_FACTOR}"
531
532
533
      --fail-on-testlist-change
      -l "${CI_PROJECT_DIR}/validate-logs/"
      --xunit-file "${CI_PROJECT_DIR}/validate-logs/xunit.xml"
534
      ${EXTRA_VALIDATE_ARGS}
535
536
537
538
539
  after_script:
    - mv gst-build/build/meson-logs/ meson-logs
    # Cleanup everything else to reduce the size
    # of the docker volume we leave behind
    - rm -rf gst-build
540
  artifacts:
541
    expire_in: '14 days'
542
543
    when: always
    paths:
544
      - 'meson-logs/'
545
      - 'validate-logs'
546
      - 'manifest.xml'
547
548
    reports:
      junit:
549
        - "validate-logs/*.xml"
550
551

.test fedora x86_64:
552
  image: $FEDORA_IMAGE
553
  extends: '.test'
554
  tags: ['gstreamer']
555
556
557
558
559

check fedora:
  extends: '.test fedora x86_64'
  variables:
    TEST_SUITE: "check.gst*"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
560
  rules:
561
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs)$/'
562

563
564
integration testsuites fedora:
  extends: '.test fedora x86_64'
565
  parallel: 4
566
  variables:
567
    EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --check-bugs --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX}"
568
    TEST_SUITE: "validate ges"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
569
  rules:
570
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-examples|gst-omx|gstreamer-sharp|gst-plugins-rs)$/'
571

572
573
574
575
gstreamer-full:
  extends: 'build static fedora x86_64'
  stage: integrate
  variables:
576
    MESON_ARGS: >
577
      --default-library=static
578
579
      -Dauto_features=disabled
      -Dgst-plugins-good:alpha=enabled
580
      $MESON_GST_WERROR
Nicolas Dufresne's avatar
Nicolas Dufresne committed
581
582
583
  rules:
    - if: '$CI_PROJECT_NAME =~ /^(gst-build|gst-ci)$/'

584
585
586
587
588
589
590
591
592
  after_script:
  - cd gst-build/
  - ninja -C build install
  - export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib64/gstreamer-1.0/pkgconfig
  - export LD_LIBRARY_PATH=/usr/local/lib64
  - cd examples/static-plugins
  - meson _build
  - ninja -C _build
  - meson test -C _build -v
593
  artifacts:
594
595
    expire_in: "7 days"
    when: "always"
596
597
598
    paths:
      - 'gst-build/build/meson-logs/'
      - 'gst-build/build/gstinitstaticplugins.c'
599

600
601
602
# Valgrind
.valgrind fedora x86_64:
  extends: '.test fedora x86_64'
Matthew Waters's avatar
Matthew Waters committed
603
  stage: 'test'
604
  variables:
605
    EXTRA_VALIDATE_ARGS: "--valgrind"
606
607
608
609
610

valgrind core:
  extends: '.valgrind fedora x86_64'
  variables:
    TEST_SUITE: "check.gstreamer\\..*"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
611
  rules:
612
    - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-ci|gst-devtools)$/'
613
614
615
616
617

valgrind base:
  extends: '.valgrind fedora x86_64'
  variables:
    TEST_SUITE: "check.gst-plugins-base\\..*"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
618
  rules:
619
    - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-ci|gst-devtools)$/'
620
621
622
623
624

valgrind good:
  extends: '.valgrind fedora x86_64'
  variables:
    TEST_SUITE: "check.gst-plugins-good\\..*"
625
626
    # take longer time due to splitmux unit test
    TIMEOUT_FACTOR: "4"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
627
  rules:
628
    - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-ci|gst-devtools)$/'
629
630
631
632
633

valgrind ugly:
  extends: '.valgrind fedora x86_64'
  variables:
    TEST_SUITE: "check.gst-plugins-ugly\\..*"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
634
  rules:
635
    - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-ugly|gst-ci|gst-devtools)$/'
636
637
638
639
640

valgrind bad:
  extends: '.valgrind fedora x86_64'
  variables:
    TEST_SUITE: "check.gst-plugins-bad\\..*"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
641
  rules:
642
    - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-plugins-bad|gst-ci|gst-devtools)$/'
643

644
645
646
647
valgrind ges:
  extends: '.valgrind fedora x86_64'
  variables:
    TEST_SUITE: "check.gst-editing-services\\..*"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
648
649
  rules:
    - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-good|gst-editing-services|gst-ci|gst-devtools)$/'
650

651
652
653
654
# Template for Cerbero GStreamer Build
#
# Parameters:
# CONFIG: The name of the configuration file to use
Matthew Waters's avatar
Matthew Waters committed
655
# ARCH: The cerbero <os>_<cpu> (used in cache key)
656
657
#
.cerbero:
Matthew Waters's avatar
Matthew Waters committed
658
  stage: "build"
659
  image: $CERBERO_IMAGE
Nicolas Dufresne's avatar
Nicolas Dufresne committed
660
661
  rules:
    - if: '$CI_PROJECT_NAME == "cerbero"'
662
663
  needs:
    - "manifest"
664
665
666
  # Ensure that the runners it will be executed on
  # will have plenty of space for the cache
  tags: ['gstreamer']
667
  timeout: '3h'
668
  variables:
669
670
671
672
673
674
675
    CCACHE_COMPILERCHECK: "content"
    CCACHE_COMPRESS: "true"
    CCACHE_BASEDIR: "/cache/gstreamer/cerbero/"
    CCACHE_DIR: "/cache/gstreamer/cerbero/ccache/"
    # shared across everything really
    CCACHE_MAXSIZE: "50G"

Matthew Waters's avatar
Matthew Waters committed
676
677
    CERBERO_HOME: "cerbero-build"
    CERBERO_SOURCES: "cerbero-sources"
678
679
    CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS}"
    CERBERO: "./cerbero-uninstalled -c config/${CONFIG} -c localconf.cbc -m manifest.xml"
Matthew Waters's avatar
Matthew Waters committed
680
    CERBERO_PACKAGE_ARGS: "-t"
681
682
    CERBERO_RUN_WRAPPER: "" # 'wine' on cross-winXX
    CERBERO_RUN_SUFFIX: "" # '.exe' on cross-winXX
Matthew Waters's avatar
Matthew Waters committed
683
684
685
    HAVE_CCACHE: "yes"
    # used by macos packages as we only ever install to a fixed directory
    CERBERO_OVERRIDDEN_DIST_DIR: ""
686
    # location where the cerbero git repo is stored on the image
687
    CERBERO_HOST_DIR: "/cerbero/"
688
  before_script:
689
    - echo "Fetching ${CERBERO_SCRIPT_URL}"
690
691
692
    - curl -L -o cerbero_script.sh "${CERBERO_SCRIPT_URL}"
    - chmod +x cerbero_script.sh
    - ./cerbero_script.sh cerbero_before_script
693
  script:
694
    - ./cerbero_script.sh cerbero_script
695
  cache:
696
    key: "${CI_JOB_NAME}"
697
698
699
700
    paths:
      - "${CERBERO_SOURCES}"
  artifacts:
    name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
701
    expire_in: '5 days'
702
703
704
    when: 'always'
    paths:
      - "manifest.xml"
Matthew Waters's avatar
Matthew Waters committed
705
      - "${CERBERO_HOME}/logs"
706
      - "*.tar.*"
707

708
.build windows:
709
  image: $WINDOWS_IMAGE
710
  stage: 'build'
711
712
  needs:
    - 'manifest'
713
714
715
  tags:
    - 'docker'
    - 'windows'
716
717
    - '1809'
  timeout: '45min'
718
719
720
721
722
723
724
  variables:
    MESON_ARGS: >
      ${DEFAULT_MESON_ARGS}
      -Dpython=disabled
      -Dlibav=disabled
      -Dvaapi=disabled
      -Ddevtools=disabled
Nicolas Dufresne's avatar
Nicolas Dufresne committed
725
726
  rules:
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs|gstreamer-vaapi)$/'
727
  script:
728
729
730
731
732
733
    # Sometimes there's seems to be an existing gst-build clone that comes either from the ether or
    # from a previous job due to some gitlab bug or implicit behavior?
    # So let's always check and clear it out if its there
    # https://gitlab.freedesktop.org/tpm/gstreamer-sharp/-/jobs/1672137
    - if (Test-Path $env:CI_PROJECT_DIR/gst-build) { Remove-Item -Recurse -Force $env:CI_PROJECT_DIR/gst-build }

734
735
736
737
    # Make sure powershell exists on errors
    # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
    - $ErrorActionPreference = "Stop"

738
739
    - 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
    - python clone_manifest_ref.py --manifest manifest.xml --project gst-build --destination $env:CI_PROJECT_DIR/gst-build
740
    - cd $env:CI_PROJECT_DIR/gst-build
741

742
    - cp -r C:/subprojects/* subprojects/
743
    # Run the git-update script and feed it the manifest to setup the environment
744
    - cd $env:CI_PROJECT_DIR/gst-build;  python git-update --no-interaction --manifest=$env:CI_PROJECT_DIR/manifest.xml
745
746
747
748
749
750
751
752
753
    # For some reason, options are separated by newline instead of space, so we
    # have to replace them first.
    - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
    # Gitlab executes PowerShell in docker, but VsDevCmd.bat is a batch script.
    # Environment variables substitutions is done by PowerShell before calling
    # cmd.exe, that's why we use $env:FOO instead of %FOO%
    - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
        meson build $env:MESON_ARGS &&
        ninja -C build"
754
755
756
757
758
759
  # XXX: Re-enable when uploading stops timing out
  #artifacts:
  #  expire_in: "7 days"
  #  when: "always"
  #  paths:
  #    - 'gst-build/build/meson-logs/'
760
761
762
763
764
765
766
767
768
769
770
771
772

build vs2017 amd64:
  extends: '.build windows'
  variables:
    ARCH: 'amd64'

build vs2017 x86:
  extends: '.build windows'
  variables:
    ARCH: 'x86'

build msys2 :
  extends: '.build windows'
773
  timeout: '60min'
774
775
776
777
  rules:
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs|gstreamer-vaapi)$/'
      allow_failure: true
      when: 'manual'
778
  script:
779
780
781
782
783
784
    # Sometimes there's seems to be an existing gst-build clone that comes either from the ether or
    # from a previous job due to some gitlab bug or implicit behavior?
    # So let's always check and clear it out if its there
    # https://gitlab.freedesktop.org/tpm/gstreamer-sharp/-/jobs/1672137
    - if (Test-Path $env:CI_PROJECT_DIR/gst-build) { Remove-Item -Recurse -Force $env:CI_PROJECT_DIR/gst-build }

785
786
787
788
    # Make sure powershell exists on errors
    # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
    - $ErrorActionPreference = "Stop"

789
790
    # For some reason docker build hangs if this is included in the image, needs more troubleshooting
    - $env:PATH += ';C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\msys64\mingw32\bin'
Nirbheek Chauhan's avatar
Nirbheek Chauhan committed
791
    # Copied from https://github.com/msys2/setup-msys2/blob/master/main.js#L98
792
    - C:\msys64\usr\bin\bash -c "pacman-key --init && pacman-key --populate msys2 && pacman-key --refresh-keys || true"
Nirbheek Chauhan's avatar
Nirbheek Chauhan committed
793
794
795
796
797
798
799
800
    - C:\msys64\usr\bin\bash -c "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf"
    - echo "Updating MSYS2"
    - C:\msys64\usr\bin\bash -c "pacman -Syuu --noconfirm || echo Update failed, ignoring"
    - echo "Killing all MSYS2 processes"
    - taskkill /F /FI "MODULES eq msys-2.0.dll"
    - echo "Completing MSYS2 update"
    - C:\msys64\usr\bin\bash -c "pacman -Suu --noconfirm"
    - echo "Installing needed MSYS2 packages"
801
802
    - C:\msys64\usr\bin\bash -c "pacman -Sy --noconfirm --needed mingw-w64-x86_64-toolchain ninja"

803
804
805
806
    - 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
    - python clone_manifest_ref.py --manifest manifest.xml --project gst-build --destination $env:CI_PROJECT_DIR/gst-build
    - cd $env:CI_PROJECT_DIR/gst-build

807
808
809
    - cp -r C:\subprojects\* subprojects\

    # Run the git-update script and feed it the manifest to setup the environment
810
    - cd $env:CI_PROJECT_DIR/gst-build; python git-update --no-interaction --manifest=$env:CI_PROJECT_DIR/manifest.xml
811
812
813
    # For some reason, options are separated by newline instead of space, so we
    # have to replace them first.
    - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
814
815
816
    # Replace forward slashes with backwards so bash doesn't complain
    - $env:_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\','/')
    - C:\msys64\usr\bin\bash -c "cd $env:_PROJECT_DIR/gst-build &&
817
818
819
820
        meson build $env:MESON_ARGS &&
        ninja -C build"


821
822
823
# Template for Cerbero GStreamer Deps
#
# This template is used by cerbero/ project to pre-built the GStreamer
Thibault Saunier's avatar
Thibault Saunier committed
824
# dependencies. When available, the .cerbero jobs will download this artifact
825
826
827
828
# in order to speed up the build.
#
# Parameters:
# CONFIG: The name of the configuration file to use
829
# ARCH: The cerbero <os>_<cpu> (used in cache key)
830
#
831
# Produce an artifact with the dist/ and .cache along
832
833
834
# with the associated build-tools.
.cerbero deps:
  extends: .cerbero
Nicolas Dufresne's avatar
Nicolas Dufresne committed
835
836
  rules:
    - if: '$CI_PROJECT_NAME == "cerbero"'
837
  script:
838
    - ./cerbero_script.sh cerbero_deps_script
839

840
841
842
#
# Cerbero Linux X86_64 build
#
843
844
cerbero deps fedora x86_64:
  extends: '.cerbero deps'
845
846
  variables:
    CONFIG: "linux.config"
847
    ARCH: "linux_x86_64"
848

849
build cerbero fedora x86_64:
850
  extends: '.cerbero'
Nicolas Dufresne's avatar
Nicolas Dufresne committed
851
852
  rules:
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'
853
854
  variables:
    CONFIG: "linux.config"
855

856
857
858
#
# Cerbero Android Universal build
#
859
.cerbero cross-android universal:
860
861
  variables:
    CONFIG: "cross-android-universal.cbc"
862
    ARCH: "android_universal"
863
864
865
866
867
868
869
  artifacts:
    name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
    expire_in: '5 days'
    when: 'always'
    paths:
      - "manifest.xml"
      - "${CERBERO_HOME}/logs"
870
      - "*[0-9].tar.*"
871

872
873
874
875
cerbero deps cross-android universal:
  extends:
    - '.cerbero deps'
    - '.cerbero cross-android universal'
876

877
build cerbero cross-android universal:
878
879
880
  extends:
    - '.cerbero'
    - '.cerbero cross-android universal'
Nicolas Dufresne's avatar
Nicolas Dufresne committed
881
  rules:
882
    - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME && $CI_PROJECT_NAME == "gst-docs"'
883
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
884

885
886
887
#
# Cerbero Cross Windows builds
#
888
cerbero deps cross-windows x86:
889
  extends: '.cerbero deps'
890
891
  variables:
    CONFIG: "cross-win32.cbc"
892
    ARCH: "mingw_x86"
893

894
build cerbero cross win32:
895
  extends: '.cerbero'
896
897
  rules:
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'
898
899
  variables:
    CONFIG: "cross-win32.cbc"
900
901
    CERBERO_RUN_WRAPPER: "wine"
    CERBERO_RUN_SUFFIX: ".exe"
902

903

904
cerbero deps cross-windows x86_64:
905
  extends: '.cerbero deps'
906
907
  variables:
    CONFIG: "cross-win64.cbc"
908
    ARCH: "mingw_x86_64"
909

910
build cerbero cross win64:
911
  extends: '.cerbero'
912
913
  rules:
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-omx|gstreamer-vaapi|gst-docs|gst-integration-testsuites|gst-plugins-rs)$/'
914
915
  variables:
    CONFIG: "cross-win64.cbc"
916
917
    CERBERO_RUN_WRAPPER: "wine"
    CERBERO_RUN_SUFFIX: ".exe"
918

919
920
921
#
# Build an Android App using the android binaries
#
922
.cross-android universal examples:
923
  image: $ANDROID_IMAGE
Matthew Waters's avatar
Matthew Waters committed
924
  stage: 'integrate'
925
926
927
928
  variables:
    EXAMPLES_HOME: ${CI_PROJECT_DIR}/examples
    GSTREAMER_ROOT_ANDROID: ${CI_PROJECT_DIR}/examples/cerbero-android-universal
  script:
929
    - mkdir -p ${EXAMPLES_HOME}/outputs
930
    - curl -L -o clone_manifest_ref.py https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/${GST_UPSTREAM_BRANCH}/gitlab/clone_manifest_ref.py
931
932
    - chmod +x clone_manifest_ref.py
    - ./clone_manifest_ref.py --manifest manifest.xml --project gst-examples --destination ${EXAMPLES_HOME}/gst-examples
933
    - ./clone_manifest_ref.py --manifest manifest.xml --project gst-docs --destination ${EXAMPLES_HOME}/gst-docs
934
935
936
    - rm clone_manifest_ref.py

    # extract our binaries
937
    - rm -f gstreamer-1.0-android-universal-*-runtime.tar.*
938
    - mkdir ${GSTREAMER_ROOT_ANDROID}
939
    - time tar -C ${GSTREAMER_ROOT_ANDROID} -xf gstreamer-1.0-android-universal-*.tar.*
940

941
    # gst-examples - player
942
    - chmod +x ${EXAMPLES_HOME}/gst-examples/playback/player/android/gradlew
943
    - ${EXAMPLES_HOME}/gst-examples/playback/player/android/gradlew --no-daemon --project-dir ${EXAMPLES_HOME}/gst-examples/playback/player/android assembleDebug
944
945
    - cp ${EXAMPLES_HOME}/gst-examples/playback/player/android/app/build/outputs/apk/debug/*.apk ${EXAMPLES_HOME}/outputs/

946
947
    # gst-examples - vulkan
    - chmod +x ${EXAMPLES_HOME}/gst-examples/vulkan/android/gradlew
948
    - ${EXAMPLES_HOME}/gst-examples/vulkan/android/gradlew --no-daemon --project-dir ${EXAMPLES_HOME}/gst-examples/vulkan/android assembleDebug
949
950
    - cp ${EXAMPLES_HOME}/gst-examples/vulkan/android/build/outputs/apk/debug/*.apk ${EXAMPLES_HOME}/outputs/

951
    # gst-docs android tutorials
952
    - chmod +x ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android/gradlew
953
    - ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android/gradlew --no-daemon --project-dir ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android assembleDebug
954
    - cp ${EXAMPLES_HOME}/gst-docs/examples/tutorials/android/android-tutorial-*/build/outputs/apk/debug/*.apk ${EXAMPLES_HOME}/outputs/
955
956
  after_script:
    - rm -rf ${GSTREAMER_ROOT_ANDROID}
957
    - rm -rf ${EXAMPLES_HOME}/gst-examples ${EXAMPLES_HOME}/gst-docs
958
959
960
961
962
963
  artifacts:
    name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
    expire_in: '5 days'
    when: 'always'
    paths:
      - "manifest.xml"
964
      - "${EXAMPLES_HOME}/outputs"
965

966
967
cross-android universal examples:
  extends: ".cross-android universal examples"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
968
  rules:
969
    - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME && $CI_PROJECT_NAME == "gst-docs"'
970
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
971
  needs:
972
    - "build cerbero cross-android universal"
973

974
975
cerbero cross-android universal examples:
  extends: ".cross-android universal examples"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
976
977
  rules:
    - if: '$CI_PROJECT_NAME == "cerbero"'
978
  needs:
979
    - "cerbero deps cross-android universal"
980

Matthew Waters's avatar
Matthew Waters committed
981
982
983
984
985
986
987
988
989
990
#
# Cerbero macOS X86_64 build
#
.cerbero macos x86_64:
  variables:
    ARCH: "darwin_x86_64"
    CONFIG: "osx-x86-64.cbc"
    CERBERO_PACKAGE_ARGS: ""
    HAVE_CCACHE: ""
    CERBERO_OVERRIDDEN_DIST_DIR: "/Library/Frameworks/GStreamer.framework/Versions/1.0"
991
    CERBERO_HOST_DIR: "/Users/gst-ci/cerbero/"
Matthew Waters's avatar
Matthew Waters committed
992
  tags:
993
    - gst-macos-10.15
Matthew Waters's avatar
Matthew Waters committed
994
995
996
997
998
999
1000
1001
1002
1003
  artifacts:
    name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
    expire_in: '5 days'
    when: 'always'
    paths:
      - "manifest.xml"
      - "${CERBERO_HOME}/logs"
      - "gstreamer-1.0-1.*.pkg"
      - "gstreamer-1.0-devel-1.*.pkg"

1004
1005
1006
1007
cerbero deps macos x86_64:
  extends:
    - '.cerbero deps'
    - '.cerbero macos x86_64'
Matthew Waters's avatar
Matthew Waters committed
1008
1009

build cerbero macos x86_64:
1010
1011
1012
  extends:
    - '.cerbero'
    - '.cerbero macos x86_64'
Nicolas Dufresne's avatar
Nicolas Dufresne committed
1013
1014
  rules:
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gst-sharp|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
Matthew Waters's avatar
Matthew Waters committed
1015

Matthew Waters's avatar
Matthew Waters committed
1016
1017
1018
#
# Cerbero iOS build
#
1019
.cerbero cross-ios universal:
Matthew Waters's avatar
Matthew Waters committed
1020
1021
1022
1023
1024
1025
  variables:
    ARCH: "ios_universal"
    CONFIG: "cross-ios-universal.cbc"
    CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS} -v nowerror"
    CERBERO_PACKAGE_ARGS: ""
    HAVE_CCACHE: ""
1026
    CERBERO_HOST_DIR: "/Users/gst-ci/cerbero/"
Matthew Waters's avatar
Matthew Waters committed
1027
  tags:
1028
    - gst-ios-13.2
Matthew Waters's avatar
Matthew Waters committed
1029
1030
1031
1032
1033
1034
1035
1036
1037
  artifacts:
    name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
    expire_in: '5 days'
    when: 'always'
    paths:
      - "manifest.xml"
      - "${CERBERO_HOME}/logs"
      - "gstreamer-1.0-*-ios-universal.pkg"

1038
1039
1040
1041
cerbero deps cross-ios universal:
  extends:
    - '.cerbero deps'
    - '.cerbero cross-ios universal'
Matthew Waters's avatar
Matthew Waters committed
1042

1043
build cerbero cross-ios universal:
1044
1045
1046
  extends:
    - '.cerbero'
    - '.cerbero cross-ios universal'
Nicolas Dufresne's avatar
Nicolas Dufresne committed
1047
  rules:
1048
    - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME && $CI_PROJECT_NAME == "gst-docs"'
Nicolas Dufresne's avatar
Nicolas Dufresne committed
1049
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gst-sharp|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
Matthew Waters's avatar
Matthew Waters committed
1050

1051
documentation:
1052
  image: $FEDORA_DOCS_IMAGE
1053
  extends:
1054
    - '.gst_build_ccache_vars'
Nicolas Dufresne's avatar
Nicolas Dufresne committed
1055
  rules:
1056
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-integration-testsuites|gst-plugins-rs|gst-python)$/'
1057
  needs:
1058
    - "manifest"
Matthew Waters's avatar
Matthew Waters committed
1059
  stage: integrate
1060
1061
  variables:
    MESON_ARGS: *simple_build
1062
    MESON_BUILDTYPE_ARGS: "-Ddoc=enabled"
1063
    CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
1064
  script:
Mathieu Duponchelle's avatar
Mathieu Duponchelle committed
1065
  - pip3 install --upgrade git+https://github.com/hotdoc/hotdoc@28ad9aa59daa49d6b3fd1bc6b144df52af39475b
1066
1067
1068
1069

  # FIXME: remove this once the docs image is updated
  - rm -rf /gst-build/subprojects/pygobject/

1070
  - *gst_build
1071
1072
1073
1074
  - ./gst-uninstalled.py ninja -C build/ plugins_doc_caches
  - |
    python3 -c "import os, subprocess, sys
    subprojects = [os.environ['CI_PROJECT_NAME']]
1075
    if subprojects[0]  in ['gst-ci', 'gst-build']:
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
        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',]

    diffsdir = '../plugins-cache-diffs'
    os.makedirs(diffsdir, exist_ok=True)
    res = 0
    for subproject in subprojects:
        cwd = os.path.join('subprojects', subproject)
        try:
            subprocess.check_call(['git', 'diff', '--quiet'], cwd=cwd)
        except subprocess.CalledProcessError:
            diffname = os.path.join(diffsdir, '%s_cache.diff' % subproject)
            res += 1
            with open(diffname, 'w') as diff:
                subprocess.check_call(['git', 'diff'], stdout=diff, cwd=cwd)
                print('\033[91mYou have a diff in the %s documentation cache. Please update with:\033[0m' % subproject)
                print('     $ curl %s/%s | git apply -' % (os.environ['CI_ARTIFACTS_URL'], diffname.replace('../', '')))
    if res != 0:
        print('(note that it might take a few minutes for artefacts to be available on the server)\n')
        sys.exit(res)"
1095