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