libav:avviddec: Add videometa if there is no videometa in output buffer
[platform/upstream/gstreamer.git] / .gitlab-ci.yml
index bcaf62e..916e47d 100644 (file)
@@ -1,12 +1,20 @@
 include:
-  - remote: "https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/14731f78c23c7b523a85a26a068ade9ac1ecd2f3/templates/fedora.yml"
-  - remote: "https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/14731f78c23c7b523a85a26a068ade9ac1ecd2f3/templates/debian.yml"
+  - project: 'freedesktop/ci-templates'
+    ref: 14731f78c23c7b523a85a26a068ade9ac1ecd2f3
+    file: '/templates/fedora.yml'
+  - project: 'freedesktop/ci-templates'
+    ref: 14731f78c23c7b523a85a26a068ade9ac1ecd2f3
+    file: '/templates/debian.yml'
+  ###
+  # 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, you need to change
+  # the appropriate version string in this file which will cause a rebuild.
+  ###
+  - local: '.gitlab-image-tags.yml'
 
 stages:
-  - 'trigger'
-  - 'build docker'
   - 'preparation'
-  - 'pre-build'
   - 'build'
   - 'test'
   # Use the resulting binaries
@@ -16,38 +24,16 @@ variables:
   GIT_DEPTH: 1
 
   # Branch to track for modules that have no ref specified in the manifest
-  GST_UPSTREAM_BRANCH: 'main'
+  GST_UPSTREAM_BRANCH: '1.22'
 
-  ###
-  # 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.
-  ###
-  FEDORA_TAG:  '2022-03-14.0'
-  INDENT_TAG: '2022-03-07.1'
-  WINDOWS_TAG: "2022-04-26.0"
-
-  GST_UPSTREAM_REPO: 'gstreamer/gstreamer'
   FDO_UPSTREAM_REPO: 'gstreamer/gstreamer'
 
-  FEDORA_AMD64_SUFFIX:  'amd64/fedora'
+  FEDORA_AMD64_SUFFIX: 'amd64/fedora'
   INDENT_AMD64_SUFFIX: 'amd64/gst-indent'
   WINDOWS_AMD64_SUFFIX: 'amd64/windows'
-  WINDOWS_RUST_AMD64_SUFFIX: 'amd64/windows-rust'
 
-  FEDORA_DOCS_IMAGE: "registry.freedesktop.org/gstreamer/gst-ci/amd64/fedora:2020-07-03.0-master"
   WINDOWS_IMAGE: "$CI_REGISTRY_IMAGE/$WINDOWS_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH"
-  WINDOWS_UPSTREAM_IMAGE: "$CI_REGISTRY/$GST_UPSTREAM_REPO/$WINDOWS_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH"
-
-  RUST_MINIMUM_VERSION: '1.57.0'
-  RUST_LATEST_VERSION: '1.60.0'
-
-  WINDOWS_RUST_MINIMUM_IMAGE: "$CI_REGISTRY_IMAGE/$WINDOWS_RUST_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH-rust-$RUST_MINIMUM_VERSION"
-  WINDOWS_RUST_MINIMUM_UPSTREAM_IMAGE: "$CI_REGISTRY/$GST_UPSTREAM_REPO/$WINDOWS_RUST_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH-rust-$RUST_MINIMUM_VERSION"
-
-  WINDOWS_RUST_LATEST_IMAGE: "$CI_REGISTRY_IMAGE/$WINDOWS_RUST_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH-rust-$RUST_LATEST_VERSION"
-  WINDOWS_RUST_LATEST_UPSTREAM_IMAGE: "$CI_REGISTRY/$GST_UPSTREAM_REPO/$WINDOWS_RUST_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH-rust-$RUST_LATEST_VERSION"
+  WINDOWS_UPSTREAM_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/$WINDOWS_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH"
 
   MESON_BUILDTYPE_ARGS: --default-library=both
   DEFAULT_MESON_ARGS: >
@@ -114,7 +100,7 @@ default:
 # This is an empty job that is used to trigger the pipeline.
 trigger:
   image: alpine:latest
-  stage: 'trigger'
+  stage: 'preparation'
   variables:
     GIT_STRATEGY: none
   script:
@@ -122,8 +108,9 @@ trigger:
   rules:
     # If the MR is assigned to the Merge bot, trigger the pipeline automatically
     - if: '$CI_MERGE_REQUEST_ASSIGNEES == "gstreamer-merge-bot"'
-    # Require explicit action to trigger tests post merge
-    - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
+    # Require explicit action to trigger tests post merge, but we want to
+    # automatically trigger the integratation stage
+    - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH && $CI_JOB_STAGE != "integrate"'
       when: 'manual'
     # When the assignee isn't the merge bot, require an explicit action to trigger the pipeline
     # to avoid wasting CI resources
@@ -142,9 +129,8 @@ fedora amd64 docker:
   extends:
     - '.fedora image'
     - '.fdo.container-build@fedora'
-  stage: 'build docker'
-  needs:
-    - "trigger"
+  stage: 'preparation'
+  needs: []
   tags:
     - 'packet.net'
 
@@ -160,14 +146,12 @@ gst-indent amd64 docker:
   extends:
     - '.gst-indent image'
     - '.fdo.container-build@debian'
-  stage: 'build docker'
+  stage: 'preparation'
   # Do not depend on the trigger, as we want to run indent always
   needs: []
 
 windows amd64 docker:
-  stage: "build docker"
-  needs:
-    - "trigger"
+  stage: "preparation"
   timeout: '3h'
   variables:
     # Unlike the buildah/linux jobs, this file
@@ -180,7 +164,7 @@ windows amd64 docker:
   tags:
     - windows
     - shell
-    - "1809"
+    - "2022"
   script:
     # We need to pass an array and to resolve the env vars, so we can't use a variable:
     - $DOCKER_BUILD_ARGS = @("--build-arg", "DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH")
@@ -192,49 +176,6 @@ windows amd64 docker:
         Exit 1
       }
 
-.windows rust docker build:
-  stage: 'build docker'
-  needs:
-    - job: 'windows amd64 docker'
-      artifacts: false
-  variables:
-    # Unlike the buildah/linux jobs, this file
-    # needs to be relative to docker/windows/ subdir
-    # as it makes life easier in the powershell script
-    #
-    # We also don't need a CONTEXT_DIR var as its also
-    # hardcoded to be docker/windows/
-    DOCKERFILE: 'ci/docker/windows/rust.Dockerfile'
-  tags:
-    - 'windows'
-    - 'shell'
-    - '1809'
-  script:
-    # We need to pass an array and to resolve the env vars, so we can't use a variable:
-    - $DOCKER_BUILD_ARGS = @("--build-arg", "DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH", "--build-arg", "BASE_IMAGE=$WINDOWS_IMAGE", "--build-arg", "RUST_VERSION=$RUST_VERSION")
-
-    - "& ci/docker/windows/container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $RUST_IMAGE $RUST_UPSTREAM_IMAGE $DOCKERFILE"
-    - |
-      if (!($?)) {
-        echo "Failed to build the image"
-        Exit 1
-      }
-
-windows rust amd64 docker latest stable:
-  extends: '.windows rust docker build'
-  variables:
-    RUST_IMAGE: !reference [variables, "WINDOWS_RUST_LATEST_IMAGE"]
-    RUST_UPSTREAM_IMAGE: !reference [variables, "WINDOWS_RUST_LATEST_UPSTREAM_IMAGE"]
-    RUST_VERSION: !reference [variables, "RUST_LATEST_VERSION"]
-
-windows rust amd64 docker minimum supported version:
-  extends: '.windows rust docker build'
-  variables:
-    RUST_IMAGE: !reference [variables, "WINDOWS_RUST_MINIMUM_IMAGE"]
-    RUST_UPSTREAM_IMAGE: !reference [variables, "WINDOWS_RUST_MINIMUM_UPSTREAM_IMAGE"]
-    RUST_VERSION: !reference [variables, "RUST_MINIMUM_VERSION"]
-
-
 
 # ---- Preparation ----- #
 #
@@ -262,12 +203,15 @@ gst indent:
 # build setup templates
 #
 .build_template: &build
+  - date -R
   - ci/scripts/handle-subprojects-cache.py subprojects/
-  # Update subprojects to respect `.wrap` content
-  - meson subprojects update --reset
+  - date -R
   - echo $MESON_ARGS
+  - date -R
   - meson build/ $MESON_ARGS
+  - date -R
   - ninja -C build/
+  - date -R
   - ccache --show-stats
 
 .build_ccache_vars:
@@ -323,7 +267,9 @@ gst indent:
   variables:
     MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
   script:
-    *build
+    - *build
+    - ./gst-env.py gst-inspect-1.0 --version
+    - ./gst-env.py gst-inspect-1.0
   after_script:
     - mv build/meson-logs/ meson-logs
   artifacts:
@@ -345,16 +291,33 @@ gst indent:
     - '.fdo.suffixed-image@fedora'
     - '.build'
   needs:
+    - "trigger"
     - "fedora amd64 docker"
   variables:
     MESON_ARGS: *simple_build
 
+build fedora x86_64:
+  extends:
+    - '.fedora image'
+    - '.fdo.suffixed-image@fedora'
+    - '.build fedora x86_64'
+  needs:
+    - "trigger"
+    - "fedora amd64 docker"
+  script:
+    - *build
+    - ./gst-env.py gst-inspect-1.0 --version
+    - ./gst-env.py gst-inspect-1.0
+    - meson install --destdir $CI_PROJECT_DIR/destdir -C build
+    - rm -rf $CI_PROJECT_DIR/destdir
+
 build nodebug fedora x86_64:
   extends:
     - '.fedora image'
     - '.fdo.suffixed-image@fedora'
     - '.build'
   needs:
+    - "trigger"
     - "fedora amd64 docker"
   variables:
     MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
@@ -371,8 +334,9 @@ build clang fedora x86_64:
   tags:
     - 'docker'
     - 'windows'
-    - '1809'
+    - '2022'
   needs:
+    - "trigger"
     - "windows amd64 docker"
   timeout: '45min'
   variables:
@@ -383,6 +347,8 @@ build clang fedora x86_64:
       -Dvaapi=disabled
       -Dgst-plugins-base:pango=enabled
       -Dgst-plugins-good:cairo=enabled
+      -Dgst-plugins-good:soup=enabled
+      -Dgst-plugins-good:soup-lookup-dep=true
     # Needs to not be empty otherwise the newline -> space replace command in
     # `script:` will fail
     MESON_CROSS_ARGS: ' '
@@ -393,7 +359,19 @@ build clang fedora x86_64:
       when: manual
     - changes:
         *modules_changes
+    - changes:
+        - subprojects/win-*/*
+  before_script:
+    # Install more recent version. We need at least 0.63 for diff_files support in wraps
+    - pip3 install -U meson==1.1.1
   script:
+    # Make sure powershell exits on errors
+    # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
+    - $ErrorActionPreference = "Stop"
+
+    # Set the code page to UTF-8
+    - chcp 65001
+
     - ci/scripts/handle-subprojects-cache.py subprojects/
     # For some reason, options are separated by newline instead of space, so we
     # have to replace them first.
@@ -401,19 +379,25 @@ build clang fedora x86_64:
     - $env:MESON_CROSS_ARGS = $env:MESON_CROSS_ARGS.replace("`n"," ")
     - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
         meson build $env:MESON_ARGS $env:MESON_CROSS_ARGS &&
-        ninja -C build"
-  # XXX: Re-enable when uploading stops timing out
-  #artifacts:
-  #  expire_in: "7 days"
-  #  when: "always"
-  #  paths:
-  #    - 'build/meson-logs/'
-  #    - 'vslogs.zip'
+        meson compile -C build"
+  artifacts:
+   expire_in: "7 days"
+   when: "always"
+   paths:
+     - 'build/meson-logs/'
 
 build vs2019 amd64:
   extends: '.build windows'
   variables:
     ARCH: 'amd64'
+  script:
+    - !reference [".build windows", "script",]
+    - cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH &&
+        .\gst-env.py gst-inspect-1.0.exe --version &&
+        .\gst-env.py gst-inspect-1.0.exe &&
+        mkdir .\destdir &&
+        meson install --destdir=$env:CI_PROJECT_DIR\destdir -C build &&
+        rmdir /s /q  $env:CI_PROJECT_DIR\destdir"
 
 build vs2019 x86:
   extends: '.build windows'
@@ -426,9 +410,12 @@ build vs2019 arm64 uwp:
     ARCH: 'arm64'
     # pango pulls in cairo which pulls in pixman which doesn't build because of
     # https://github.com/mesonbuild/meson/issues/9889
+    # libsoup requires glib-compile-resources, which isn't available in a cross
+    # build
     MESON_CROSS_ARGS: >
       -Dgst-plugins-base:pango=disabled
       -Dgst-plugins-good:cairo=disabled
+      -Dgst-plugins-good:soup-lookup-dep=false
       -Dgst-devtools:cairo=disabled
       --cross-file ci/meson/vs2019-arm64-cross-file.txt
       --native-file ci/meson/vs2019-x64-native-file.txt
@@ -446,6 +433,9 @@ build msys2 :
     # https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_preference_variables?view=powershell-6
     - $ErrorActionPreference = "Stop"
 
+    # Set the code page to UTF-8
+    - chcp 65001
+
     # Configure MSYS2 to use the UCRT64 environment, start in the same directory
     # and inherit PATH
     - $env:MSYSTEM = "UCRT64"
@@ -488,7 +478,6 @@ build msys2 :
     - >
       ./gst-env.py
       gst-validate-launcher ${TEST_SUITE}
-      --check-bugs
       --dump-on-failure
       --mute
       --shuffle
@@ -517,6 +506,7 @@ build msys2 :
     - '.fdo.suffixed-image@fedora'
     - '.test'
   needs:
+    - "trigger"
     - "fedora amd64 docker"
   tags: ['gstreamer']
 
@@ -527,8 +517,23 @@ check fedora:
 
 integration testsuites fedora:
   extends: '.test fedora x86_64'
-  parallel: 4
+  parallel: 8
   variables:
+    MESON_BUILDTYPE_ARGS: >
+      -Domx=disabled
+      -Dsharp=disabled
+      -Dvaapi=disabled
+      -Dexamples=disabled
+      -Dgst-examples=disabled
+      -Dtests=disabled
+      -Dnls=disabled
+      -Dqt5=disabled
+      -Dgstreamer:benchmarks=disabled
+      -Dgst-plugins-good:gtk3=disabled
+      -Dgst-plugins-bad:microdns=disabled
+      -Dgst-plugins-bad:avtp=disabled
+      -Dgst-plugins-bad:opencv=disabled
+      -Dgst-plugins-bad:webrtc=disabled
     EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX} --sync"
     TEST_SUITE: "validate ges"
 
@@ -677,27 +682,36 @@ valgrind ges:
       - subprojects/gst-plugins-bad/**/*
       - subprojects/gst-editing-services/**/*
       - subprojects/gst-python/**/*
+  # valgrind ges jobs are racy across the board and simply fail too often.
+  # Someone needs to go through job logs and figure out which jobs to mark
+  # as flaky. Until then, just ignore failures.
+  allow_failure: true
 
 # ---- Integration ----- #
 
 .documentation:
-  image: $FEDORA_DOCS_IMAGE
-  extends:
-    - '.build_ccache_vars'
+  extends: '.build fedora x86_64'
   variables:
     MESON_ARGS: *simple_build
-    MESON_BUILDTYPE_ARGS: "-Ddoc=enabled"
+    MESON_BUILDTYPE_ARGS: "-Ddoc=enabled -Drs=enabled -Dgst-docs:fatal_warnings=true"
+    # Disable werror for the docs build, we don't need it
+    MESON_GST_WERROR: ''
     CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/"
   script:
-  # FIXME: should rebuild the image with newer versions!
-  - pip3 install --upgrade hotdoc
-  - pip3 install --upgrade meson
-  - *build
+  - export PATH=/usr/local/cargo/bin/:/usr/local/bin/:$PATH
+  - export RUSTUP_HOME='/usr/local/rustup'
+
+  - ci/scripts/handle-subprojects-cache.py subprojects/
+  - echo $MESON_ARGS
+  - meson build/ $MESON_ARGS
+  - ccache --show-stats
+
   - ./gst-env.py ninja -C build/ plugins_doc_caches
   # Ignore modifications to wrap files made by meson
   - git checkout subprojects/*.wrap
   - ./ci/scripts/check-documentation-diff.py
-  - ./gst-env.py hotdoc run --conf-file=build/subprojects/gst-docs/GStreamer-doc.json --fatal-warnings
+
+  - ./gst-env.py ninja -C build subprojects/gst-docs/GStreamer-doc
   - mv build/subprojects/gst-docs/GStreamer-doc/html documentation/
 
   artifacts:
@@ -715,7 +729,8 @@ documentation:
   stage: integrate
   extends:
     - '.documentation'
-  needs: []
+  needs:
+    - "fedora amd64 docker"
   rules:
     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == "main"'
 
@@ -729,6 +744,7 @@ build documentation:
   stage: build
   needs:
     - "trigger"
+    - "fedora amd64 docker"
   rules:
     # Never run post merge, we have the `documentation` always running for that
     - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
@@ -754,13 +770,14 @@ build documentation:
 # https://gitlab.com/gitlab-org/gitlab/-/issues/341737
 cerbero trigger:
   stage: build
-  timeout: '3h'
+  timeout: '4h'
   tags:
     - placeholder-job
   extends:
     - '.fedora image'
     - '.fdo.suffixed-image@fedora'
   needs:
+    - "trigger"
     - "fedora amd64 docker"
   script:
     - ci/gitlab/trigger_cerbero_pipeline.py