ci: run ninja install post build
[platform/upstream/gstreamer.git] / .gitlab-ci.yml
1 include:
2   - remote: "https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/14731f78c23c7b523a85a26a068ade9ac1ecd2f3/templates/fedora.yml"
3   - remote: "https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/14731f78c23c7b523a85a26a068ade9ac1ecd2f3/templates/debian.yml"
4
5 stages:
6   - 'trigger'
7   - 'build docker'
8   - 'preparation'
9   - 'pre-build'
10   - 'build'
11   - 'test'
12   # Use the resulting binaries
13   - 'integrate'
14
15 variables:
16   GIT_DEPTH: 1
17
18   # Branch to track for modules that have no ref specified in the manifest
19   GST_UPSTREAM_BRANCH: 'main'
20
21   ###
22   # IMPORTANT
23   # These are the version tags for the docker images the CI runs against.
24   # If you are hacking on them or need a them to rebuild, its enough
25   # to change any part of the string of the image you want.
26   ###
27   FEDORA_TAG:  '2022-03-14.0'
28   INDENT_TAG: '2022-03-07.1'
29   WINDOWS_TAG: "2022-05-16.1"
30
31   GST_UPSTREAM_REPO: 'gstreamer/gstreamer'
32   FDO_UPSTREAM_REPO: 'gstreamer/gstreamer'
33
34   FEDORA_AMD64_SUFFIX:  'amd64/fedora'
35   INDENT_AMD64_SUFFIX: 'amd64/gst-indent'
36   WINDOWS_AMD64_SUFFIX: 'amd64/windows'
37
38   FEDORA_DOCS_IMAGE: "registry.freedesktop.org/gstreamer/gst-ci/amd64/fedora:2020-07-03.0-master"
39   WINDOWS_IMAGE: "$CI_REGISTRY_IMAGE/$WINDOWS_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH"
40   WINDOWS_UPSTREAM_IMAGE: "$CI_REGISTRY/$GST_UPSTREAM_REPO/$WINDOWS_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH"
41
42   MESON_BUILDTYPE_ARGS: --default-library=both
43   DEFAULT_MESON_ARGS: >
44     -Dlibnice:tests=disabled
45     -Dlibnice:examples=disabled
46     -Dopenh264:tests=disabled
47     -Dpygobject:tests=false
48     -Dpython=enabled
49     -Dlibav=enabled
50     -Dugly=enabled
51     -Dbad=enabled
52     -Ddevtools=enabled
53     -Dges=enabled
54     -Drtsp_server=enabled
55     -Dvaapi=enabled
56     -Dsharp=disabled
57     -Dgpl=enabled
58
59   MESON_GST_WERROR: >
60     -Dgstreamer:werror=true
61     -Dgst-plugins-base:werror=true
62     -Dgst-plugins-good:werror=true
63     -Dgst-plugins-ugly:werror=true
64     -Dgst-plugins-bad:werror=true
65     -Dgst-rtsp-server:werror=true
66     -Dgst-libav:werror=true
67     -Dgst-examples:werror=true
68     -Dgst-editing-services:werror=true
69     -Dgst-docs:werror=true
70     -Dgst-omx:werror=true
71     -Dgst-devtools:werror=true
72     -Dgst-python:werror=true
73     -Dgstreamer-vaapi:werror=true
74     -Dgstreamer-sharp:werror=true
75
76 workflow:
77   # https://docs.gitlab.com/ee/ci/yaml/index.html#switch-between-branch-pipelines-and-merge-request-pipelines
78   rules:
79     - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
80       variables:
81         GIT_FETCH_EXTRA_FLAGS: '--no-tags'
82     - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
83       when: never
84     - if: '$CI_COMMIT_TAG'
85     - if: '$CI_COMMIT_BRANCH'
86       variables:
87         GIT_FETCH_EXTRA_FLAGS: '--no-tags'
88
89 #
90 # Global CI policy
91 #
92 # This can be used to configure global behaviour our our jobs.
93 #
94 default:
95   retry:
96     max: 2
97     when:
98       - 'runner_system_failure'
99       - 'stuck_or_timeout_failure'
100       - 'scheduler_failure'
101       - 'api_failure'
102   interruptible: true
103
104 # This is an empty job that is used to trigger the pipeline.
105 trigger:
106   image: alpine:latest
107   stage: 'trigger'
108   variables:
109     GIT_STRATEGY: none
110   script:
111     - echo "Trigger job done, now running the pipeline."
112   rules:
113     # If the MR is assigned to the Merge bot, trigger the pipeline automatically
114     - if: '$CI_MERGE_REQUEST_ASSIGNEES == "gstreamer-merge-bot"'
115     # Require explicit action to trigger tests post merge
116     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
117       when: 'manual'
118     # When the assignee isn't the merge bot, require an explicit action to trigger the pipeline
119     # to avoid wasting CI resources
120     - if: '$CI_MERGE_REQUEST_ASSIGNEES != "gstreamer-merge-bot"'
121       when: 'manual'
122       allow_failure: false
123
124 .fedora image:
125   variables:
126     FDO_DISTRIBUTION_VERSION: '31'
127     FDO_REPO_SUFFIX: "$FEDORA_AMD64_SUFFIX"
128     FDO_DISTRIBUTION_TAG: "$FEDORA_TAG-$GST_UPSTREAM_BRANCH"
129     FDO_DISTRIBUTION_EXEC: 'GIT_BRANCH=$CI_COMMIT_REF_NAME GIT_URL=$CI_REPOSITORY_URL bash ci/docker/fedora/prepare.sh'
130
131 fedora amd64 docker:
132   extends:
133     - '.fedora image'
134     - '.fdo.container-build@fedora'
135   stage: 'build docker'
136   needs:
137     - "trigger"
138   tags:
139     - 'packet.net'
140
141 .gst-indent image:
142   variables:
143     FDO_DISTRIBUTION_VERSION: 'stretch'
144     FDO_REPO_SUFFIX: "$INDENT_AMD64_SUFFIX"
145     FDO_DISTRIBUTION_TAG: "$INDENT_TAG-$GST_UPSTREAM_BRANCH"
146     FDO_DISTRIBUTION_PACKAGES: 'curl indent git findutils'
147     FDO_DISTRIBUTION_EXEC: 'ci/docker/indent/prepare.sh'
148
149 gst-indent amd64 docker:
150   extends:
151     - '.gst-indent image'
152     - '.fdo.container-build@debian'
153   stage: 'build docker'
154   # Do not depend on the trigger, as we want to run indent always
155   needs: []
156
157 windows amd64 docker:
158   stage: "build docker"
159   needs:
160     - "trigger"
161   timeout: '3h'
162   variables:
163     # Unlike the buildah/linux jobs, this file
164     # needs to be relative to docker/windows/ subdir
165     # as it makes life easier in the powershell script
166     #
167     # We also don't need a CONTEXT_DIR var as its also
168     # hardcoded to be docker/windows/
169     DOCKERFILE: "ci/docker/windows/Dockerfile"
170   tags:
171     - windows
172     - shell
173     - "2022"
174   script:
175     # We need to pass an array and to resolve the env vars, so we can't use a variable:
176     - $DOCKER_BUILD_ARGS = @("--build-arg", "DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH")
177
178     - "& ci/docker/windows/container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $WINDOWS_IMAGE $WINDOWS_UPSTREAM_IMAGE $DOCKERFILE"
179     - |
180       if (!($?)) {
181         echo "Failed to build the image"
182         Exit 1
183       }
184
185
186 # ---- Preparation ----- #
187 #
188 # gst-indent!!
189 #
190 gst indent:
191   extends:
192     - '.gst-indent image'
193     - '.fdo.suffixed-image@debian'
194   stage: 'preparation'
195   needs:
196     - job: 'gst-indent amd64 docker'
197       artifacts: false
198   script:
199     - ./scripts/check-format-c
200     - ./scripts/format-csharp --check
201   rules:
202     # Don't check indentation on post merge pipelines
203     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
204       when: 'manual'
205     - if: '$CI_PROJECT_NAMESPACE != "gstreamer" || $CI_COMMIT_BRANCH != $GST_UPSTREAM_BRANCH'
206       when: 'always'
207
208 #
209 # build setup templates
210 #
211 .build_template: &build
212   - ci/scripts/handle-subprojects-cache.py subprojects/
213   # Update subprojects to respect `.wrap` content
214   - meson subprojects update --reset
215   - echo $MESON_ARGS
216   - meson build/ $MESON_ARGS
217   - ninja -C build/
218   - ccache --show-stats
219
220 .build_ccache_vars:
221   variables:
222     CCACHE_COMPILERCHECK: 'content'
223     CCACHE_COMPRESS: 'true'
224     CCACHE_BASEDIR: '/cache/gstreamer/gstreamer'
225     CCACHE_DIR: '/cache/gstreamer/gstreamer/ccache/'
226     # shared across everything really
227     CCACHE_MAXSIZE: '10G'
228     CARGO_HOME: '/cache/gstreamer/cargo'
229
230 .base_modules_changes: &modules_changes
231   - .gitlab-ci.yml
232   - gst-env.py
233   - ci/gitlab/*.py
234   - meson.build
235   - subprojects/*.wrap
236   - subprojects/gst-devtools/**/*
237   - subprojects/gst-editing-services/**/*
238   - subprojects/gst-integration-testsuites/**/*
239   - subprojects/gst-libav/**/*
240   - subprojects/gst-omx/**/*
241   - subprojects/gst-plugins-bad/**/*
242   - subprojects/gst-plugins-base/**/*
243   - subprojects/gst-plugins-good/**/*
244   - subprojects/gst-plugins-ugly/**/*
245   - subprojects/gst-python/**/*
246   - subprojects/gstreamer/**/*
247   - subprojects/gstreamer-sharp/**/*
248   - subprojects/gstreamer-vaapi/**/*
249   - subprojects/gst-rtsp-server/**/*
250
251 .simple_fedora_build: &simple_build >-
252   ${DEFAULT_MESON_ARGS}
253   -Dsharp=enabled
254   -Domx=enabled
255   -Dgst-omx:target=generic
256   -Ddoc=disabled
257   -Drs=disabled
258   ${MESON_BUILDTYPE_ARGS}
259   ${MESON_GST_WERROR}
260
261 .build:
262   stage: 'build'
263   extends:
264     - '.build_ccache_vars'
265   needs:
266     - "trigger"
267   # Taking into account the slowest shared runner + time needed to upload the binaries to artifacts
268   # Also need to take into account I/O of pulling docker images and uploading artifacts
269   timeout: '45min'
270   variables:
271     MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
272   script:
273     *build
274   after_script:
275     - mv build/meson-logs/ meson-logs
276   artifacts:
277     expire_in: "7 days"
278     when: "always"
279     paths:
280       - 'meson-logs/'
281   rules:
282     # If this matches, it means the pipeline is running against either the main
283     # or a stable branch, so make it manual
284     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
285       when: manual
286     - changes:
287         *modules_changes
288
289 .build fedora x86_64:
290   extends:
291     - '.fedora image'
292     - '.fdo.suffixed-image@fedora'
293     - '.build'
294   needs:
295     - "fedora amd64 docker"
296   variables:
297     MESON_ARGS: *simple_build
298
299 build fedora x86_64:
300   extends:
301     - '.fedora image'
302     - '.fdo.suffixed-image@fedora'
303     - '.build fedora x86_64'
304   needs:
305     - "fedora amd64 docker"
306   script:
307     - *build
308     - ./gst-env.py gst-inspect-1.0 --version
309     - ./gst-env.py gst-inspect-1.0
310     - meson install --destdir $CI_PROJECT_DIR/destdir -C build
311     - rm -rf $CI_PROJECT_DIR/destdir
312
313 build nodebug fedora x86_64:
314   extends:
315     - '.fedora image'
316     - '.fdo.suffixed-image@fedora'
317     - '.build'
318   needs:
319     - "fedora amd64 docker"
320   variables:
321     MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
322
323 build clang fedora x86_64:
324   extends: '.build fedora x86_64'
325   variables:
326     CC: 'ccache clang'
327     CXX: 'ccache clang++'
328
329 .build windows:
330   image: $WINDOWS_IMAGE
331   stage: 'build'
332   tags:
333     - 'docker'
334     - 'windows'
335     - '2022'
336   needs:
337     - "windows amd64 docker"
338   timeout: '45min'
339   variables:
340     MESON_ARGS: >
341       ${DEFAULT_MESON_ARGS}
342       -Dpython=disabled
343       -Dlibav=disabled
344       -Dvaapi=disabled
345       -Dgst-plugins-base:pango=enabled
346       -Dgst-plugins-good:cairo=enabled
347     # Needs to not be empty otherwise the newline -> space replace command in
348     # `script:` will fail
349     MESON_CROSS_ARGS: ' '
350   rules:
351     # If this matches, it means the pipeline is running against either the main
352     # or a stable branch, so make it manual
353     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
354       when: manual
355     - changes:
356         *modules_changes
357   script:
358     # Make sure powershell exits on errors
359     # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
360     - $ErrorActionPreference = "Stop"
361
362     # Set the code page to UTF-8
363     - chcp 65001
364
365     - ci/scripts/handle-subprojects-cache.py subprojects/
366     # For some reason, options are separated by newline instead of space, so we
367     # have to replace them first.
368     - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
369     - $env:MESON_CROSS_ARGS = $env:MESON_CROSS_ARGS.replace("`n"," ")
370     - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
371         meson build $env:MESON_ARGS $env:MESON_CROSS_ARGS &&
372         meson compile -C build"
373   artifacts:
374    expire_in: "7 days"
375    when: "always"
376    paths:
377      - 'build/meson-logs/'
378
379 build vs2019 amd64:
380   extends: '.build windows'
381   variables:
382     ARCH: 'amd64'
383   script:
384     - !reference [".build windows", "script",]
385     - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
386         mkdir .\destdir &&
387         meson install --destdir=$env:CI_PROJECT_DIR\destdir -C build &&
388         rmdir /s /q  $env:CI_PROJECT_DIR\destdir"
389
390 build vs2019 x86:
391   extends: '.build windows'
392   variables:
393     ARCH: 'x86'
394
395 build vs2019 arm64 uwp:
396   extends: '.build windows'
397   variables:
398     ARCH: 'arm64'
399     # pango pulls in cairo which pulls in pixman which doesn't build because of
400     # https://github.com/mesonbuild/meson/issues/9889
401     MESON_CROSS_ARGS: >
402       -Dgst-plugins-base:pango=disabled
403       -Dgst-plugins-good:cairo=disabled
404       -Dgst-devtools:cairo=disabled
405       --cross-file ci/meson/vs2019-arm64-cross-file.txt
406       --native-file ci/meson/vs2019-x64-native-file.txt
407
408 build msys2 :
409   extends: '.build windows'
410   timeout: '60min'
411   rules:
412     - changes:
413         *modules_changes
414       allow_failure: true
415       when: 'manual'
416   script:
417     # Make sure powershell exits on errors
418     # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
419     - $ErrorActionPreference = "Stop"
420
421     # Set the code page to UTF-8
422     - chcp 65001
423
424     # Configure MSYS2 to use the UCRT64 environment, start in the same directory
425     # and inherit PATH
426     - $env:MSYSTEM = "UCRT64"
427     - $env:CHERE_INVOKING = "1"
428     - $env:MSYS2_PATH_TYPE = "inherit"
429     # For some reason, options are separated by newline instead of space, so we
430     # have to replace them first.
431     - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
432     # Replace forward slashes with backwards so bash doesn't complain
433     - $env:_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\','/')
434     - C:\msys64\usr\bin\bash -lc "meson build $env:MESON_ARGS && ninja -C build"
435
436 # ---- Tests ----- #
437
438 .test:
439   stage: 'test'
440   extends:
441     - '.build_ccache_vars'
442   needs:
443     - "trigger"
444   variables:
445     MESON_ARGS: *simple_build
446
447     # Disable colored output to avoid weird rendering issues
448     GST_DEBUG_NO_COLOR: "true"
449     CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/validate-logs/"
450     GST_VALIDATE_LAUNCHER_FORCE_COLORS: "true"
451     TIMEOUT_FACTOR: "2"
452     CARGO_HOME: "/cache/gstreamer/cargo"
453     # Enable the fault handler so we get backtraces on segfaults.
454     # any non-empty string will do
455     PYTHONFAULTHANDLER: "enabled"
456   rules:
457     - changes:
458         *modules_changes
459   script:
460     - *build
461
462     - echo "-> Running ${TEST_SUITE}"
463     - >
464       ./gst-env.py
465       gst-validate-launcher ${TEST_SUITE}
466       --check-bugs
467       --dump-on-failure
468       --mute
469       --shuffle
470       --no-display
471       --meson-no-rebuild
472       --timeout-factor "${TIMEOUT_FACTOR}"
473       --fail-on-testlist-change
474       -l "${CI_PROJECT_DIR}/validate-logs/"
475       --xunit-file "${CI_PROJECT_DIR}/validate-logs/xunit.xml"
476       ${EXTRA_VALIDATE_ARGS}
477   after_script:
478     - mv build/meson-logs/ meson-logs
479   artifacts:
480     expire_in: '14 days'
481     when: always
482     paths:
483       - 'meson-logs/'
484       - 'validate-logs'
485     reports:
486       junit:
487         - "validate-logs/*.xml"
488
489 .test fedora x86_64:
490   extends:
491     - '.fedora image'
492     - '.fdo.suffixed-image@fedora'
493     - '.test'
494   needs:
495     - "fedora amd64 docker"
496   tags: ['gstreamer']
497
498 check fedora:
499   extends: '.test fedora x86_64'
500   variables:
501     TEST_SUITE: "check.gst*"
502
503 integration testsuites fedora:
504   extends: '.test fedora x86_64'
505   parallel: 4
506   variables:
507     EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX} --sync"
508     TEST_SUITE: "validate ges"
509
510 # gstreamer-full:
511 gstreamer-full static build:
512   extends: '.build fedora x86_64'
513   stage: 'build'
514   variables:
515     MESON_ARGS: >
516       --default-library=static
517       -Ddoc=disabled
518       $MESON_GST_WERROR
519
520   script:
521   - *build
522   - meson test -C build -v test-gst-full
523   artifacts:
524     expire_in: "7 days"
525     when: "always"
526     paths:
527       - 'meson-logs/'
528
529 gstreamer-full-minimal static build:
530   extends: 'gstreamer-full static build'
531   stage: 'build'
532   variables:
533     MESON_ARGS: >
534       --default-library=static
535       -Ddoc=disabled
536       -Dgstreamer:gst_debug=false
537       -Dauto_features=disabled
538       -Dgstreamer:check=enabled
539       -Dtests=enabled
540       -Dgst-plugins-base:alsa=enabled
541       -Dgst-plugins-base:typefind=enabled
542       -Dgst-plugins-base:pbtypes=enabled
543       -Dgst-full-elements=coreelements:filesrc,fakesink,identity,input-selector
544       -Dgst-full-typefind-functions=typefindfunctions:wav,flv
545       -Dgst-full-device-providers=alsa:alsadeviceprovider
546       -Dgst-full-dynamic-types=pbtypes:video_multiview_flagset
547       $MESON_GST_WERROR
548
549   script:
550   - *build
551   - meson test -C build -v test-gst-full
552   - meson test -C build test-gst-full-features --test-args "-e filesrc,identity,fakesink -E filesink,capsfilter -t audio/x-wav -T video/vivo -d alsadeviceprovider -D v4l2deviceprovider -l GstVideoMultiviewFlagsSet"
553   - strip build/libgstreamer-full-1.0.so
554   - ls -l build/libgstreamer-full-1.0.so
555   artifacts:
556     expire_in: "7 days"
557     when: "always"
558     paths:
559       - 'meson-logs/'
560
561 # Valgrind
562 .valgrind fedora x86_64:
563   extends: '.test fedora x86_64'
564   stage: 'test'
565   variables:
566     EXTRA_VALIDATE_ARGS: "--valgrind"
567
568 valgrind core:
569   extends: '.valgrind fedora x86_64'
570   variables:
571     TEST_SUITE: "check.gstreamer\\..*"
572   rules:
573     - changes:
574       - "*"
575       - scripts/*
576       - ci/**/*
577       - subprojects/gst-devtools/**/*
578       - subprojects/gstreamer/**/*
579
580 valgrind base:
581   extends: '.valgrind fedora x86_64'
582   variables:
583     TEST_SUITE: "check.gst-plugins-base\\..*"
584   rules:
585     - changes:
586       - "*"
587       - scripts/*
588       - ci//**/*
589       - subprojects/gst-devtools/**/*
590       - subprojects/gstreamer/**/*
591       - subprojects/gst-plugins-base/**/*
592
593 valgrind good:
594   extends: '.valgrind fedora x86_64'
595   variables:
596     TEST_SUITE: "check.gst-plugins-good\\..*"
597     # take longer time due to splitmux unit test
598     TIMEOUT_FACTOR: "4"
599   rules:
600     - changes:
601       - "*"
602       - scripts/*
603       - ci/**/*
604       - subprojects/gst-devtools/**/*
605       - subprojects/gstreamer/**/*
606       - subprojects/gst-plugins-base/**/*
607       - subprojects/gst-plugins-good/**/*
608
609 valgrind ugly:
610   extends: '.valgrind fedora x86_64'
611   variables:
612     TEST_SUITE: "check.gst-plugins-ugly\\..*"
613   rules:
614     - changes:
615       - "*"
616       - scripts/*
617       - ci/**/*
618       - subprojects/gst-devtools/**/*
619       - subprojects/gstreamer/**/*
620       - subprojects/gst-plugins-base/**/*
621       - subprojects/gst-plugins-good/**/*
622       - subprojects/gst-plugins-ugly/**/*
623
624 valgrind bad:
625   extends: '.valgrind fedora x86_64'
626   variables:
627     TEST_SUITE: "check.gst-plugins-bad\\..*"
628   rules:
629     - changes:
630       - "*"
631       - scripts/*
632       - ci/**/*
633       - subprojects/gst-devtools/**/*
634       - subprojects/gstreamer/**/*
635       - subprojects/gst-plugins-base/**/*
636       - subprojects/gst-plugins-good/**/*
637       - subprojects/gst-plugins-bad/**/*
638
639 valgrind ges:
640   extends: '.valgrind fedora x86_64'
641   variables:
642     TEST_SUITE: "check.gst-editing-services\\..*"
643   rules:
644     - changes:
645       - "*"
646       - scripts/*
647       - ci/**/*
648       - subprojects/gst-devtools/**/*
649       - subprojects/gstreamer/**/*
650       - subprojects/gst-plugins-base/**/*
651       - subprojects/gst-plugins-good/**/*
652       - subprojects/gst-plugins-bad/**/*
653       - subprojects/gst-editing-services/**/*
654       - subprojects/gst-python/**/*
655
656 # ---- Integration ----- #
657
658 .documentation:
659   image: $FEDORA_DOCS_IMAGE
660   extends:
661     - '.build_ccache_vars'
662   variables:
663     MESON_ARGS: *simple_build
664     MESON_BUILDTYPE_ARGS: "-Ddoc=enabled"
665     CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
666   script:
667   # FIXME: should rebuild the image with newer versions!
668   - pip3 install --upgrade hotdoc
669   - pip3 install --upgrade meson
670   - *build
671   - ./gst-env.py ninja -C build/ plugins_doc_caches
672   # Ignore modifications to wrap files made by meson
673   - git checkout subprojects/*.wrap
674   - ./ci/scripts/check-documentation-diff.py
675   - ./gst-env.py hotdoc run --conf-file=build/subprojects/gst-docs/GStreamer-doc.json --fatal-warnings
676   - mv build/subprojects/gst-docs/GStreamer-doc/html documentation/
677
678   artifacts:
679     when: always
680     expire_in: "7 days"
681     paths:
682     - documentation/
683     - plugins-cache-diffs/
684
685 #
686 # This jobs runs in gstreamer namespace when after the merge into main branch.
687 # The produced artifact is later used to automatically update the web page.
688 #
689 documentation:
690   stage: integrate
691   extends:
692     - '.documentation'
693   needs: []
694   rules:
695     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == "main"'
696
697 #
698 # This job is run in users namespace to validate documentation before merging
699 # MR.
700 #
701 build documentation:
702   extends:
703     - '.documentation'
704   stage: build
705   needs:
706     - "trigger"
707   rules:
708     # Never run post merge, we have the `documentation` always running for that
709     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
710       when: never
711     - changes:
712       - .gitlab-ci.yml
713       - ci/gitlab/*.py
714       - subprojects/*.wrap
715       - subprojects/gst-docs/**/*
716       - subprojects/gst-devtools/**/*
717       - subprojects/gst-editing-services/**/*
718       - subprojects/gst-libav/**/*
719       - subprojects/gst-omx/**/*
720       - subprojects/gst-plugins-bad/**/*
721       - subprojects/gst-plugins-base/**/*
722       - subprojects/gst-plugins-good/**/*
723       - subprojects/gst-plugins-ugly/**/*
724       - subprojects/gstreamer/**/*
725       - subprojects/gstreamer-vaapi/**/*
726       - subprojects/gst-rtsp-server/**/*
727
728 # FIXME: Using trigger: causes permission issues, workaround using old REST API.
729 # https://gitlab.com/gitlab-org/gitlab/-/issues/341737
730 cerbero trigger:
731   stage: build
732   timeout: '3h'
733   tags:
734     - placeholder-job
735   extends:
736     - '.fedora image'
737     - '.fdo.suffixed-image@fedora'
738   needs:
739     - "fedora amd64 docker"
740   script:
741     - ci/gitlab/trigger_cerbero_pipeline.py
742
743   rules:
744     # Never run post merge
745     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
746       when: never
747     - changes:
748       - .gitlab-ci.yml
749       - ci/gitlab/*.py
750       - subprojects/gst-devtools/**/*
751       - subprojects/gst-editing-services/**/*
752       - subprojects/gst-libav/**/*
753       - subprojects/gst-plugins-bad/**/*
754       - subprojects/gst-plugins-base/**/*
755       - subprojects/gst-plugins-good/**/*
756       - subprojects/gst-plugins-ugly/**/*
757       - subprojects/gst-python/**/*
758       - subprojects/gstreamer/**/*
759       - subprojects/gst-rtsp-server/**/*
760       - subprojects/gst-examples/**/*