ci_template.yml 41.6 KB
Newer Older
1
stages:
2
  - 'build docker'
3
  - 'preparation'
Matthew Waters's avatar
Matthew Waters committed
4
  - 'pre-build'
5
6
  - 'build'
  - 'test'
Matthew Waters's avatar
Matthew Waters committed
7
8
  # Use the resulting binaries
  - 'integrate'
9
10

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

  ###
  # 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.
  ###
21
22
23
24
25
26
  FEDORA_TAG:  '2020-10-22.0'
  CERBERO_TAG: '2020-10-22.0'
  ANDROID_TAG: '2020-10-22.0'
  MANIFEST_TAG: '2020-10-22.0'
  TEST_MANIFEST_TAG: '2020-10-22.0'
  INDENT_TAG: '2020-10-22.0'
27
28
29
30
31
32
33
34

  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'
35
  INDENT_AMD64_SUFFIX: 'amd64/gst-indent'
36
37

  FEDORA_IMAGE:   "$CI_REGISTRY_IMAGE/$FEDORA_AMD64_SUFFIX:$FEDORA_TAG-$GST_UPSTREAM_BRANCH"
38
  FEDORA_DOCS_IMAGE: "registry.freedesktop.org/gstreamer/gst-ci/amd64/fedora:2020-07-03.0-master"
39
40
41
42
  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"
43
  INDENT_IMAGE:   "$CI_REGISTRY_IMAGE/$INDENT_AMD64_SUFFIX:$INDENT_TAG-$GST_UPSTREAM_BRANCH"
44

45
  WINDOWS_IMAGE: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/windows:v13-master'
46

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

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

67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
  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

84
  DEFAULT_CERBERO_ARGS: >
85
86
    --variants werror
    --timestamps
87

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

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

# 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

127
128
129
    # 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

130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
    # 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

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

149
      echo "Copying image from gstreamer/gst-ci to local registry"
150
151
152
153
154
155
156
157
158
159
160
161
      # 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

162
163
    set +x

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

171
      echo "Copying image from $CI_PROJECT_NAMESPACE/gst-ci to local registry"
172
173
174
175
176
177
178
179
180
181
182
183
      # 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

184
185
186
    # if we have a local image but none in the upstream repo, use our
    if [ -s local_sha ]
    then
187
      echo "Using $LOCAL_IMAGE"
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
      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:
204
  image: "$CI_REGISTRY/freedesktop/ci-templates/buildah:2020-07-20.1"
205
206
207
208
209
210
211
212
  variables:
    STORAGE_DRIVER: 'vfs'
    BUILDAH_FORMAT: 'docker'
    BUILDAH_ISOLATION: 'chroot'

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

216
217
218
219
220
221
222
223
224
225
    # 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

226
227
228
229
    # 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

230
    - *check_image_exists
231

232
233
234
235
236
237
238
239
240
    # 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

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
315
    - 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
      -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"
316
    TAG: "$INDENT_TAG-$GST_UPSTREAM_BRANCH"
317
318
319
320
321
322
323
324

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

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

333
334
335
    # If the MR is assigned to the Merge bot, trigger the pipeline automatically
    - if: '$CI_MERGE_REQUEST_ASSIGNEES == "gstreamer-merge-bot"'
    # When the assignee isn't the merge bot, require an explicit action to trigger the pipeline
336
    # to avoid wasting CI resources
337
    - if: '$CI_MERGE_REQUEST_ASSIGNEES != "gstreamer-merge-bot"'
338
339
340
      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
      -Dauto_features=disabled
579
580
      -Dgstreamer:check=enabled
      -Dtests=enabled
581
      $MESON_GST_WERROR
Nicolas Dufresne's avatar
Nicolas Dufresne committed
582
583
584
  rules:
    - if: '$CI_PROJECT_NAME =~ /^(gst-build|gst-ci)$/'

585
586
587
  script:
  - *gst_build
  - meson test -C build -v test-gst-full
588
  artifacts:
589
590
    expire_in: "7 days"
    when: "always"
591
    paths:
592
      - 'meson-logs/'
593

594
595
596
# Valgrind
.valgrind fedora x86_64:
  extends: '.test fedora x86_64'
Matthew Waters's avatar
Matthew Waters committed
597
  stage: 'test'
598
  variables:
599
    EXTRA_VALIDATE_ARGS: "--valgrind"
600
601
602
603
604

valgrind core:
  extends: '.valgrind fedora x86_64'
  variables:
    TEST_SUITE: "check.gstreamer\\..*"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
605
  rules:
606
    - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-ci|gst-devtools)$/'
607
608
609
610
611

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

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

valgrind ugly:
  extends: '.valgrind fedora x86_64'
  variables:
    TEST_SUITE: "check.gst-plugins-ugly\\..*"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
628
  rules:
629
    - if: '$CI_PROJECT_NAME =~ /^(gstreamer|gst-plugins-base|gst-plugins-ugly|gst-ci|gst-devtools)$/'
630
631
632
633
634

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

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

645
646
647
648
# Template for Cerbero GStreamer Build
#
# Parameters:
# CONFIG: The name of the configuration file to use
Matthew Waters's avatar
Matthew Waters committed
649
# ARCH: The cerbero <os>_<cpu> (used in cache key)
650
651
#
.cerbero:
Matthew Waters's avatar
Matthew Waters committed
652
  stage: "build"
653
  image: $CERBERO_IMAGE
Nicolas Dufresne's avatar
Nicolas Dufresne committed
654
655
  rules:
    - if: '$CI_PROJECT_NAME == "cerbero"'
656
657
  needs:
    - "manifest"
658
659
660
  # Ensure that the runners it will be executed on
  # will have plenty of space for the cache
  tags: ['gstreamer']
661
  timeout: '3h'
662
  variables:
663
664
665
666
667
668
669
    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
670
671
    CERBERO_HOME: "cerbero-build"
    CERBERO_SOURCES: "cerbero-sources"
672
673
    CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS}"
    CERBERO: "./cerbero-uninstalled -c config/${CONFIG} -c localconf.cbc -m manifest.xml"
Matthew Waters's avatar
Matthew Waters committed
674
    CERBERO_PACKAGE_ARGS: "-t"
675
676
    CERBERO_RUN_WRAPPER: "" # 'wine' on cross-winXX
    CERBERO_RUN_SUFFIX: "" # '.exe' on cross-winXX
Matthew Waters's avatar
Matthew Waters committed
677
678
679
    HAVE_CCACHE: "yes"
    # used by macos packages as we only ever install to a fixed directory
    CERBERO_OVERRIDDEN_DIST_DIR: ""
680
    # location where the cerbero git repo is stored on the image
681
    CERBERO_HOST_DIR: "/cerbero/"
682
  before_script:
683
    - echo "Fetching ${CERBERO_SCRIPT_URL}"
684
685
686
    - curl -L -o cerbero_setup.sh "${CERBERO_SCRIPT_URL}"
    - chmod +x cerbero_setup.sh
    - ./cerbero_setup.sh cerbero_before_script
687
  script:
688
    - ./cerbero_setup.sh cerbero_script
689
  cache:
690
    key: "${CI_JOB_NAME}"
691
692
693
694
    paths:
      - "${CERBERO_SOURCES}"
  artifacts:
    name: "${CI_JOB_NAME}_${CI_COMMIT_SHA}"
695
    expire_in: '5 days'
696
697
698
    when: 'always'
    paths:
      - "manifest.xml"
Matthew Waters's avatar
Matthew Waters committed
699
      - "${CERBERO_HOME}/logs"
700
      - "*.tar.*"
701

702
.build windows:
703
  image: $WINDOWS_IMAGE
704
  stage: 'build'
705
706
  needs:
    - 'manifest'
707
708
709
  tags:
    - 'docker'
    - 'windows'
710
711
    - '1809'
  timeout: '45min'
712
713
714
715
716
717
718
  variables:
    MESON_ARGS: >
      ${DEFAULT_MESON_ARGS}
      -Dpython=disabled
      -Dlibav=disabled
      -Dvaapi=disabled
      -Ddevtools=disabled
719
      -Dgst-plugins-base:pango=enabled
Nicolas Dufresne's avatar
Nicolas Dufresne committed
720
721
  rules:
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs|gstreamer-vaapi)$/'
722
  script:
723
724
725
726
727
728
    # 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 }

729
730
731
732
    # 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"

733
734
    - 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
735
    - cd $env:CI_PROJECT_DIR/gst-build
736

737
    - cp -r C:/subprojects/* subprojects/
738
    # Run the git-update script and feed it the manifest to setup the environment
739
    - cd $env:CI_PROJECT_DIR/gst-build;  python git-update --no-interaction --manifest=$env:CI_PROJECT_DIR/manifest.xml
740
741
742
743
744
745
746
747
748
    # 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"
749
750
751
752
753
754
  # XXX: Re-enable when uploading stops timing out
  #artifacts:
  #  expire_in: "7 days"
  #  when: "always"
  #  paths:
  #    - 'gst-build/build/meson-logs/'
755
756
757
758
759
760
761
762
763
764
765
766
767

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

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

build msys2 :
  extends: '.build windows'
768
  timeout: '60min'
769
770
771
772
  rules:
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-docs|gst-integration-testsuites|gst-omx|gst-plugins-rs|gstreamer-vaapi)$/'
      allow_failure: true
      when: 'manual'
773
  script:
774
775
776
777
778
779
    # 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 }

780
781
782
783
    # 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"

784
785
    # 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
786
    # Copied from https://github.com/msys2/setup-msys2/blob/master/main.js#L98
787
    - 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
788
789
790
791
792
793
794
795
    - 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"
796
797
    - C:\msys64\usr\bin\bash -c "pacman -Sy --noconfirm --needed mingw-w64-x86_64-toolchain ninja"

798
799
800
801
    - 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

802
803
804
    - cp -r C:\subprojects\* subprojects\

    # Run the git-update script and feed it the manifest to setup the environment
805
    - cd $env:CI_PROJECT_DIR/gst-build; python git-update --no-interaction --manifest=$env:CI_PROJECT_DIR/manifest.xml
806
807
808
    # 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"," ")
809
810
811
    # 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 &&
812
813
814
815
        meson build $env:MESON_ARGS &&
        ninja -C build"


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

835
836
837
#
# Cerbero Linux X86_64 build
#
838
839
cerbero deps fedora x86_64:
  extends: '.cerbero deps'
840
841
  variables:
    CONFIG: "linux.config"
842
    ARCH: "linux_x86_64"
843

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

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

867
868
869
870
cerbero deps cross-android universal:
  extends:
    - '.cerbero deps'
    - '.cerbero cross-android universal'
871

872
build cerbero cross-android universal:
873
874
875
  extends:
    - '.cerbero'
    - '.cerbero cross-android universal'
Nicolas Dufresne's avatar
Nicolas Dufresne committed
876
  rules:
877
    - if: '$CI_MERGE_REQUEST_IID && $CI_PROJECT_NAME == "gst-docs"'
878
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
879

880
881
882
#
# Cerbero Cross Windows builds
#
883
cerbero deps cross-windows x86:
884
  extends: '.cerbero deps'
885
886
  variables:
    CONFIG: "cross-win32.cbc"
887
    ARCH: "mingw_x86"
888

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

898

899
cerbero deps cross-windows x86_64:
900
  extends: '.cerbero deps'
901
902
  variables:
    CONFIG: "cross-win64.cbc"
903
    ARCH: "mingw_x86_64"
904

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

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

    # extract our binaries
932
    - rm -f gstreamer-1.0-android-universal-*-runtime.tar.*
933
    - mkdir ${GSTREAMER_ROOT_ANDROID}
934
    - time tar -C ${GSTREAMER_ROOT_ANDROID} -xf gstreamer-1.0-android-universal-*.tar.*
935

936
    # gst-examples - player
937
    - chmod +x ${EXAMPLES_HOME}/gst-examples/playback/player/android/gradlew
938
    - ${EXAMPLES_HOME}/gst-examples/playback/player/android/gradlew --no-daemon --project-dir ${EXAMPLES_HOME}/gst-examples/playback/player/android assembleDebug
939
940
    - cp ${EXAMPLES_HOME}/gst-examples/playback/player/android/app/build/outputs/apk/debug/*.apk ${EXAMPLES_HOME}/outputs/

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

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

961
962
cross-android universal examples:
  extends: ".cross-android universal examples"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
963
  rules:
964
    - if: '$CI_MERGE_REQUEST_IID && $CI_PROJECT_NAME == "gst-docs"'
965
    - if: '$CI_PROJECT_NAME !~ /^(cerbero|gst-build|gst-docs|gst-omx|gstreamer-vaapi|gst-integration-testsuites|gst-plugins-rs)$/'
966
  needs:
967
    - "build cerbero cross-android universal"
968

969
970
cerbero cross-android universal examples:
  extends: ".cross-android universal examples"
Nicolas Dufresne's avatar
Nicolas Dufresne committed
971
972
  rules:
    - if: '$CI_PROJECT_NAME == "cerbero"'
973
  needs:
974
    - "cerbero deps cross-android universal"
975

Matthew Waters's avatar
Matthew Waters committed
976
977
978
979
980
981
982
983
984
985
#
# 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"
986
    CERBERO_HOST_DIR: "/Users/gst-ci/cerbero/"
Matthew Waters's avatar
Matthew Waters committed
987
  tags:
988
    - gst-macos-10.15
Matthew Waters's avatar
Matthew Waters committed
989
990
991
992
993
994
995
996
997
998
  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"

999
1000
1001
1002
cerbero deps macos x86_64:
  extends:
    - '.cerbero deps'
    - '.cerbero macos x86_64'
Matthew Waters's avatar
Matthew Waters committed
1003
1004

build cerbero macos x86_64:
1005
1006
1007
  extends:
    - '.cerbero'
    - '.cerbero macos x86_64'
Nicolas Dufresne's avatar
Nicolas Dufresne committed
1008
1009
  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
1010

Matthew Waters's avatar
Matthew Waters committed
1011
1012
1013
#
# Cerbero iOS build
#
1014
.cerbero cross-ios universal:
Matthew Waters's avatar
Matthew Waters committed
1015
1016
1017
1018
1019
1020
  variables:
    ARCH: "ios_universal"
    CONFIG: "cross-ios-universal.cbc"
    CERBERO_ARGS: "${DEFAULT_CERBERO_ARGS} -v nowerror"
    CERBERO_PACKAGE_ARGS: ""
    HAVE_CCACHE: ""
1021
    CERBERO_HOST_DIR: "/Users/gst-ci/cerbero/"
Matthew Waters's avatar
Matthew Waters committed
1022
  tags:
1023
    - gst-ios-13.2
Matthew Waters's avatar
Matthew Waters committed
1024
1025
1026
1027
1028
1029
1030
1031
1032
  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"

1033
1034
1035
1036
cerbero deps cross-ios universal:
  extends:
    - '.cerbero deps'
    - '.cerbero cross-ios universal'
Matthew Waters's avatar
Matthew Waters committed
1037

1038
build cerbero cross-ios universal:
1039
1040
1041
  extends:
    - '.cerbero'
    - '.cerbero cross-ios universal'
Nicolas Dufresne's avatar
Nicolas Dufresne committed
1042
  rules:
1043
    - if: '$CI_MERGE_REQUEST_IID && $CI_PROJECT_NAME == "gst-docs"'
Nicolas Dufresne's avatar
Nicolas Dufresne committed
1044
    - 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
1045

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

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

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