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