subprojects: pin gst-plugins-rs for GStreamer 1.21.2 release
[platform/upstream/gstreamer.git] / .gitlab-ci.yml
index 310f8ee..24d6713 100644 (file)
-include: "gitlab/ci_template.yml"
+include:
+  - 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:
-  - "build docker"
-  - "preparation"
-  - "pre-build"
-  - "build"
-  - "test"
-  # use the binaries in some way
-  - "integrate"
-
-test manifest:
+  - 'preparation'
+  - 'build'
+  - 'test'
+  # Use the resulting binaries
+  - 'integrate'
+
+variables:
+  GIT_DEPTH: 1
+
+  # Branch to track for modules that have no ref specified in the manifest
+  GST_UPSTREAM_BRANCH: 'main'
+
+  FDO_UPSTREAM_REPO: 'gstreamer/gstreamer'
+
+  FEDORA_AMD64_SUFFIX: 'amd64/fedora'
+  INDENT_AMD64_SUFFIX: 'amd64/gst-indent'
+  WINDOWS_AMD64_SUFFIX: 'amd64/windows'
+
+  WINDOWS_IMAGE: "$CI_REGISTRY_IMAGE/$WINDOWS_AMD64_SUFFIX:$WINDOWS_TAG-$GST_UPSTREAM_BRANCH"
+  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: >
+    -Dlibnice:tests=disabled
+    -Dlibnice:examples=disabled
+    -Dopenh264:tests=disabled
+    -Dpygobject:tests=false
+    -Dpython=enabled
+    -Dlibav=enabled
+    -Dugly=enabled
+    -Dbad=enabled
+    -Ddevtools=enabled
+    -Dges=enabled
+    -Drtsp_server=enabled
+    -Dvaapi=enabled
+    -Dsharp=disabled
+    -Dgpl=enabled
+
+  MESON_GST_WERROR: >
+    -Dgstreamer:werror=true
+    -Dgst-plugins-base:werror=true
+    -Dgst-plugins-good:werror=true
+    -Dgst-plugins-ugly:werror=true
+    -Dgst-plugins-bad:werror=true
+    -Dgst-rtsp-server:werror=true
+    -Dgst-libav:werror=true
+    -Dgst-examples:werror=true
+    -Dgst-editing-services:werror=true
+    -Dgst-docs:werror=true
+    -Dgst-omx:werror=true
+    -Dgst-devtools:werror=true
+    -Dgst-python:werror=true
+    -Dgstreamer-vaapi:werror=true
+    -Dgstreamer-sharp:werror=true
+
+workflow:
+  # https://docs.gitlab.com/ee/ci/yaml/index.html#switch-between-branch-pipelines-and-merge-request-pipelines
+  rules:
+    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
+      variables:
+        GIT_FETCH_EXTRA_FLAGS: '--no-tags'
+    - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
+      when: never
+    - if: '$CI_COMMIT_TAG'
+    - if: '$CI_COMMIT_BRANCH'
+      variables:
+        GIT_FETCH_EXTRA_FLAGS: '--no-tags'
+
+#
+# Global CI policy
+#
+# This can be used to configure global behaviour our our jobs.
+#
+default:
+  retry:
+    max: 2
+    when:
+      - 'runner_system_failure'
+      - 'stuck_or_timeout_failure'
+      - 'scheduler_failure'
+      - 'api_failure'
+  interruptible: true
+
+# This is an empty job that is used to trigger the pipeline.
+trigger:
+  image: alpine:latest
+  stage: 'preparation'
   variables:
-    GIT_STRATEGY: fetch
+    GIT_STRATEGY: none
+  script:
+    - echo "Trigger job done, now running the pipeline."
   rules:
-    - when: 'always'
-  image: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/test-manifest:2019-10-23-793476'
+    # 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, 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
+    - if: '$CI_MERGE_REQUEST_ASSIGNEES != "gstreamer-merge-bot"'
+      when: 'manual'
+      allow_failure: false
+
+.fedora image:
+  variables:
+    FDO_DISTRIBUTION_VERSION: '31'
+    FDO_REPO_SUFFIX: "$FEDORA_AMD64_SUFFIX"
+    FDO_DISTRIBUTION_TAG: "$FEDORA_TAG-$GST_UPSTREAM_BRANCH"
+    FDO_DISTRIBUTION_EXEC: 'GIT_BRANCH=$CI_COMMIT_REF_NAME GIT_URL=$CI_REPOSITORY_URL bash ci/docker/fedora/prepare.sh'
+
+fedora amd64 docker:
+  extends:
+    - '.fedora image'
+    - '.fdo.container-build@fedora'
+  stage: 'preparation'
+  needs: []
+  tags:
+    - 'packet.net'
+
+.gst-indent image:
+  variables:
+    FDO_DISTRIBUTION_VERSION: 'stretch'
+    FDO_REPO_SUFFIX: "$INDENT_AMD64_SUFFIX"
+    FDO_DISTRIBUTION_TAG: "$INDENT_TAG-$GST_UPSTREAM_BRANCH"
+    FDO_DISTRIBUTION_PACKAGES: 'curl indent git findutils'
+    FDO_DISTRIBUTION_EXEC: 'ci/docker/indent/prepare.sh'
+
+gst-indent amd64 docker:
+  extends:
+    - '.gst-indent image'
+    - '.fdo.container-build@debian'
+  stage: 'preparation'
+  # Do not depend on the trigger, as we want to run indent always
+  needs: []
+
+windows amd64 docker:
   stage: "preparation"
+  needs:
+    - "trigger"
+  timeout: '3h'
+  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/Dockerfile"
+  tags:
+    - windows
+    - shell
+    - "2022"
   script:
-    - pytest-3 --junitxml=junit.xml --cov=build_manifest gitlab/build_manifest.py
-  coverage: '/TOTAL.*\s+(\d+%)$/'
-  artifacts:
-    reports:
-      junit:
-        - "junit.xml"
-
-# have a special definition for the test if the image already exists
-.check_image: &check_image_exists |
-  # if-not-exists steps
-  set -x
-
-  if [[ -z "$GST_FORCE_REBUILD" ]]
-  then
-    # disable exit on failure
-    set +e
-
-    # check if our image is already in the current registry
-    # we store the sha of the digest and the layers
-    skopeo inspect docker://$LOCAL_IMAGE | jq '[.Digest, .Layers]' > local_sha
-
-    # check if our image is already in the upstream registry
-    if [[ -z "$GST_UPSTREAM_REPO" ]]
-    then
-      echo "WARNING! Variable \$GST_UPSTREAM_REPO is undefined, cannot check for images"
-    else
-      skopeo inspect docker://$GST_UPSTREAM_IMAGE | jq '[.Digest, .Layers]' > upstream_sha
-    fi
-
-    # reenable exit on failure
-    set -e
-
-    # if the upstream repo has an image, ensure we use the same
-    if [ -s upstream_sha ]
-    then
-
-      # ensure we use the same image from upstream
-      diff upstream_sha local_sha && exit 0 || true
-
-      # copy the original image into the current project registry namespace
-      # we do 2 attempts with skopeo copy at most
-      skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
-                  docker://$GST_UPSTREAM_IMAGE \
-                  docker://$LOCAL_IMAGE || \
-      skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD \
-                  docker://$GST_UPSTREAM_IMAGE \
-                  docker://$LOCAL_IMAGE
-
-      exit 0
-    fi
-
-    # if we have a local image but none in the upstream repo, use our
-    if [ -s local_sha ]
-    then
-      exit 0
-    fi
-  fi
-
-  set +x
-
-.base:
-  image: 'registry.fedoraproject.org/fedora:32'
+    # 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")
+
+    - "& ci/docker/windows/container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $WINDOWS_IMAGE $WINDOWS_UPSTREAM_IMAGE $DOCKERFILE"
+    - |
+      if (!($?)) {
+        echo "Failed to build the image"
+        Exit 1
+      }
+
+
+# ---- Preparation ----- #
+#
+# gst-indent!!
+#
+gst indent:
   extends:
-    - '.global_ci_policy'
-  tags: ['gstreamer']
+    - '.gst-indent image'
+    - '.fdo.suffixed-image@debian'
+  stage: 'preparation'
+  needs:
+    - job: 'gst-indent amd64 docker'
+      artifacts: false
+  script:
+    - ./scripts/check-format-c
+    - ./scripts/format-csharp --check
   rules:
-    - when: 'manual'
-      allow_failure: true
+    # Don't check indentation on post merge pipelines
+    - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
+      when: 'manual'
+    - if: '$CI_PROJECT_NAMESPACE != "gstreamer" || $CI_COMMIT_BRANCH != $GST_UPSTREAM_BRANCH'
+      when: 'always'
+
+#
+# build setup templates
+#
+.build_template: &build
+  - ci/scripts/handle-subprojects-cache.py subprojects/
+  - echo $MESON_ARGS
+  - meson build/ $MESON_ARGS
+  - ninja -C build/
+  - ccache --show-stats
+
+.build_ccache_vars:
   variables:
-    STORAGE_DRIVER: 'vfs'
-    BUILDAH_FORMAT: 'docker'
-    BUILDAH_ISOLATION: 'chroot'
-
-    # FIXME: Probably needs to be changed to none and clone gst-ci repo each time, sigh
-    # as these jobs *could* run potentially in a fork of smth like -bad
-    # though given our current setup, its only possible to tweak the CI from a gst-ci
-    # fork so it might be fine
-    GIT_STRATEGY: fetch
+    CCACHE_COMPILERCHECK: 'content'
+    CCACHE_COMPRESS: 'true'
+    CCACHE_BASEDIR: '/cache/gstreamer/gstreamer'
+    CCACHE_DIR: '/cache/gstreamer/gstreamer/ccache/'
+    # shared across everything really
+    CCACHE_MAXSIZE: '10G'
+    CARGO_HOME: '/cache/gstreamer/cargo'
+
+.base_modules_changes: &modules_changes
+  - .gitlab-ci.yml
+  - gst-env.py
+  - ci/gitlab/*.py
+  - meson.build
+  - subprojects/*.wrap
+  - subprojects/gst-devtools/**/*
+  - subprojects/gst-editing-services/**/*
+  - subprojects/gst-integration-testsuites/**/*
+  - subprojects/gst-libav/**/*
+  - subprojects/gst-omx/**/*
+  - subprojects/gst-plugins-bad/**/*
+  - subprojects/gst-plugins-base/**/*
+  - subprojects/gst-plugins-good/**/*
+  - subprojects/gst-plugins-ugly/**/*
+  - subprojects/gst-python/**/*
+  - subprojects/gstreamer/**/*
+  - subprojects/gstreamer-sharp/**/*
+  - subprojects/gstreamer-vaapi/**/*
+  - subprojects/gst-rtsp-server/**/*
+
+.simple_fedora_build: &simple_build >-
+  ${DEFAULT_MESON_ARGS}
+  -Dsharp=enabled
+  -Domx=enabled
+  -Dgst-omx:target=generic
+  -Ddoc=disabled
+  -Drs=disabled
+  ${MESON_BUILDTYPE_ARGS}
+  ${MESON_GST_WERROR}
+
+.build:
+  stage: 'build'
+  extends:
+    - '.build_ccache_vars'
+  needs:
+    - "trigger"
+  # Taking into account the slowest shared runner + time needed to upload the binaries to artifacts
+  # Also need to take into account I/O of pulling docker images and uploading artifacts
+  timeout: '45min'
+  variables:
+    MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
   script:
-    - echo $TAG
-    - echo $REPO_SUFFIX
+    - *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:
+    expire_in: "7 days"
+    when: "always"
+    paths:
+      - 'meson-logs/'
+  rules:
+    # If this matches, it means the pipeline is running against either the main
+    # or a stable branch, so make it manual
+    - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
+      when: manual
+    - changes:
+        *modules_changes
+
+.build fedora x86_64:
+  extends:
+    - '.fedora image'
+    - '.fdo.suffixed-image@fedora'
+    - '.build'
+  needs:
+    - "trigger"
+    - "fedora amd64 docker"
+  variables:
+    MESON_ARGS: *simple_build
 
-    - export LOCAL_IMAGE="$CI_REGISTRY_IMAGE/$REPO_SUFFIX:$TAG"
-    - export GST_UPSTREAM_IMAGE="$GST_UPSTREAM_REPO/$REPO_SUFFIX:$TAG"
+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
 
-    - echo $LOCAL_IMAGE
-    - echo $GST_UPSTREAM_IMAGE
+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}"
 
-    # FIXME: make an image since there will be multiple jobs running every pipeline
-    - dnf install -y buildah skopeo jq runc
+build clang fedora x86_64:
+  extends: '.build fedora x86_64'
+  variables:
+    CC: 'ccache clang'
+    CXX: 'ccache clang++'
 
-    # Newer versions of podman/buildah try to set overlayfs mount options when
-    # using the vfs driver, and this causes errors.
-    - sed -i '/^mountopt =.*/d' /etc/containers/storage.conf
+.build windows:
+  image: $WINDOWS_IMAGE
+  stage: 'build'
+  tags:
+    - 'docker'
+    - 'windows'
+    - '2022'
+  needs:
+    - "trigger"
+    - "windows amd64 docker"
+  timeout: '45min'
+  variables:
+    MESON_ARGS: >
+      ${DEFAULT_MESON_ARGS}
+      -Dpython=disabled
+      -Dlibav=disabled
+      -Dvaapi=disabled
+      -Dgst-plugins-base:pango=enabled
+      -Dgst-plugins-good:cairo=enabled
+    # Needs to not be empty otherwise the newline -> space replace command in
+    # `script:` will fail
+    MESON_CROSS_ARGS: ' '
+  rules:
+    # If this matches, it means the pipeline is running against either the main
+    # or a stable branch, so make it manual
+    - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
+      when: manual
+    - changes:
+        *modules_changes
+    - changes:
+        - subprojects/win-*/*
+  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.
+    - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
+    - $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 &&
+        meson compile -C build"
+  artifacts:
+   expire_in: "7 days"
+   when: "always"
+   paths:
+     - 'build/meson-logs/'
 
-    - *check_image_exists
+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'
+  variables:
+    ARCH: 'x86'
 
-    - echo "Building image $LOCAL_IMAGE"
+build vs2019 arm64 uwp:
+  extends: '.build windows'
+  variables:
+    ARCH: 'arm64'
+    # pango pulls in cairo which pulls in pixman which doesn't build because of
+    # https://github.com/mesonbuild/meson/issues/9889
+    MESON_CROSS_ARGS: >
+      -Dgst-plugins-base:pango=disabled
+      -Dgst-plugins-good:cairo=disabled
+      -Dgst-devtools:cairo=disabled
+      --cross-file ci/meson/vs2019-arm64-cross-file.txt
+      --native-file ci/meson/vs2019-x64-native-file.txt
+
+build msys2 :
+  extends: '.build windows'
+  timeout: '60min'
+  rules:
+    - changes:
+        *modules_changes
+      allow_failure: true
+      when: 'manual'
+  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
+
+    # Configure MSYS2 to use the UCRT64 environment, start in the same directory
+    # and inherit PATH
+    - $env:MSYSTEM = "UCRT64"
+    - $env:CHERE_INVOKING = "1"
+    - $env:MSYS2_PATH_TYPE = "inherit"
+    # For some reason, options are separated by newline instead of space, so we
+    # have to replace them first.
+    - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
+    # Replace forward slashes with backwards so bash doesn't complain
+    - $env:_PROJECT_DIR = $env:CI_PROJECT_DIR.replace('\','/')
+    - C:\msys64\usr\bin\bash -lc "meson build $env:MESON_ARGS && ninja -C build"
+
+# ---- Tests ----- #
+
+.test:
+  stage: 'test'
+  extends:
+    - '.build_ccache_vars'
+  needs:
+    - "trigger"
+  variables:
+    MESON_ARGS: *simple_build
+
+    # Disable colored output to avoid weird rendering issues
+    GST_DEBUG_NO_COLOR: "true"
+    CI_ARTIFACTS_URL: "${CI_PROJECT_URL}/-/jobs/${CI_JOB_ID}/artifacts/raw/validate-logs/"
+    GST_VALIDATE_LAUNCHER_FORCE_COLORS: "true"
+    TIMEOUT_FACTOR: "2"
+    CARGO_HOME: "/cache/gstreamer/cargo"
+    # Enable the fault handler so we get backtraces on segfaults.
+    # any non-empty string will do
+    PYTHONFAULTHANDLER: "enabled"
+  rules:
+    - changes:
+        *modules_changes
+  script:
+    - *build
 
+    - echo "-> Running ${TEST_SUITE}"
     - >
-      buildah bud
-      --build-arg DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH
-      --arch=${ARCH:=amd64}
-      --label ci.job_id=$CI_JOB_ID
-      --label pipeline.url=$CI_PIPELINE_URL
-      --label git.ref_name=$CI_COMMIT_REF_NAME
-      --label git.sha=$CI_COMMIT_SHA
-      --label gitlab.project_path=$CI_PROJECT_PATH
-      --label gitlab.project_url=$CI_PROJECT_URL
-      --label fdo.upstream-repo=$GST_UPSTREAM_REPO
-      --label fdo.expires-after="3w"
-      -f $DOCKERFILE
-      -t $LOCAL_IMAGE
-      $CONTEXT_DIR
-
-    - buildah login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
-
-    # Sanity check
-    - |
-      if [ "$CI_PROJECT_PATH" = "gstreamer/gst-ci" ]; then
-        if [ "$LOCAL_IMAGE" != "$GST_UPSTREAM_IMAGE" ]; then
-          echo "ERROR!!! AAAAA! THE IMAGE URI DOES NOT MATCH THE EXPECTED UPSTREAM ONE"
-          echo $LOCAL_IMAGE
-          echo $GST_UPSTRAM_IMAGE
-          exit 1
-        fi
-      fi
-
-    -  buildah push $LOCAL_IMAGE
-
-alpine amd64 manifest builder docker:
-  stage: "build docker"
-  variables:
-    TAG: "build-manifest"
-    CONTEXT_DIR: "docker/build_manifest/"
-    DOCKERFILE: "docker/build_manifest/Dockerfile"
-  extends: .base
+      ./gst-env.py
+      gst-validate-launcher ${TEST_SUITE}
+      --check-bugs
+      --dump-on-failure
+      --mute
+      --shuffle
+      --no-display
+      --meson-no-rebuild
+      --timeout-factor "${TIMEOUT_FACTOR}"
+      --fail-on-testlist-change
+      -l "${CI_PROJECT_DIR}/validate-logs/"
+      --xunit-file "${CI_PROJECT_DIR}/validate-logs/xunit.xml"
+      ${EXTRA_VALIDATE_ARGS}
+  after_script:
+    - mv build/meson-logs/ meson-logs
+  artifacts:
+    expire_in: '14 days'
+    when: always
+    paths:
+      - 'meson-logs/'
+      - 'validate-logs'
+    reports:
+      junit:
+        - "validate-logs/*.xml"
 
-test manifest amd64 docker:
-  stage: "build docker"
+.test fedora x86_64:
+  extends:
+    - '.fedora image'
+    - '.fdo.suffixed-image@fedora'
+    - '.test'
+  needs:
+    - "trigger"
+    - "fedora amd64 docker"
+  tags: ['gstreamer']
+
+check fedora:
+  extends: '.test fedora x86_64'
   variables:
-    TAG: "test-manifest"
-    CONTEXT_DIR: "docker/test_manifest/"
-    DOCKERFILE: "docker/test_manifest/Dockerfile"
-  extends: .base
+    TEST_SUITE: "check.gst*"
 
-gst-indent amd64 docker:
-  stage: "build docker"
+integration testsuites fedora:
+  extends: '.test fedora x86_64'
+  parallel: 4
   variables:
-    TAG: "gst-indent"
-    CONTEXT_DIR: "docker/indent/"
-    DOCKERFILE: "docker/indent/Dockerfile"
-  extends: .base
+    EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX} --sync"
+    TEST_SUITE: "validate ges"
 
-fedora amd64 docker:
-  stage: "build docker"
+# gstreamer-full:
+gstreamer-full static build:
+  extends: '.build fedora x86_64'
+  stage: 'build'
   variables:
-    REPO_SUFFIX: "amd64/fedora"
-    TAG: "2020-06-18.0-$GST_UPSTREAM_BRANCH"
+    MESON_ARGS: >
+      --default-library=static
+      -Ddoc=disabled
+      $MESON_GST_WERROR
 
-    CONTEXT_DIR: "docker/fedora/"
-    DOCKERFILE: "docker/fedora/Dockerfile"
-  extends: .base
+  script:
+  - *build
+  - meson test -C build -v test-gst-full
+  artifacts:
+    expire_in: "7 days"
+    when: "always"
+    paths:
+      - 'meson-logs/'
 
-cerbero fedora amd64 docker:
-  stage: "build docker"
+gstreamer-full-minimal static build:
+  extends: 'gstreamer-full static build'
+  stage: 'build'
   variables:
-    TAG: "cerbero-fedora"
-    CONTEXT_DIR: "docker/cerbero/"
-    DOCKERFILE: "docker/cerbero/Dockerfile-fedora"
-  extends: .base
+    MESON_ARGS: >
+      --default-library=static
+      -Ddoc=disabled
+      -Dgstreamer:gst_debug=false
+      -Dauto_features=disabled
+      -Dgstreamer:check=enabled
+      -Dtests=enabled
+      -Dgst-plugins-base:alsa=enabled
+      -Dgst-plugins-base:typefind=enabled
+      -Dgst-plugins-base:pbtypes=enabled
+      -Dgst-full-elements=coreelements:filesrc,fakesink,identity,input-selector
+      -Dgst-full-typefind-functions=typefindfunctions:wav,flv
+      -Dgst-full-device-providers=alsa:alsadeviceprovider
+      -Dgst-full-dynamic-types=pbtypes:video_multiview_flagset
+      $MESON_GST_WERROR
+
+  script:
+  - *build
+  - meson test -C build -v test-gst-full
+  - 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"
+  - strip build/libgstreamer-full-1.0.so
+  - ls -l build/libgstreamer-full-1.0.so
+  artifacts:
+    expire_in: "7 days"
+    when: "always"
+    paths:
+      - 'meson-logs/'
 
-android docker:
-  stage: "build docker"
+# Valgrind
+.valgrind fedora x86_64:
+  extends: '.test fedora x86_64'
+  stage: 'test'
   variables:
-    TAG: "android"
-    CONTEXT_DIR: "docker/android/"
-    DOCKERFILE: "docker/android/Dockerfile"
-  extends: .base
+    EXTRA_VALIDATE_ARGS: "--valgrind"
 
-.local_rules: &local_rules
+valgrind core:
+  extends: '.valgrind fedora x86_64'
+  variables:
+    TEST_SUITE: "check.gstreamer\\..*"
   rules:
-    - if: '$CI_COMMIT_REF_NAME == "master" && $CI_PROJECT_PATH == "gstreamer/gst-ci"'
-      when: 'never'
-    - when: 'manual'
-      allow_failure: true
+    - changes:
+      - "*"
+      - scripts/*
+      - ci/**/*
+      - subprojects/gst-devtools/**/*
+      - subprojects/gstreamer/**/*
+
+valgrind base:
+  extends: '.valgrind fedora x86_64'
+  variables:
+    TEST_SUITE: "check.gst-plugins-base\\..*"
+  rules:
+    - changes:
+      - "*"
+      - scripts/*
+      - ci//**/*
+      - subprojects/gst-devtools/**/*
+      - subprojects/gstreamer/**/*
+      - subprojects/gst-plugins-base/**/*
+
+valgrind good:
+  extends: '.valgrind fedora x86_64'
+  variables:
+    TEST_SUITE: "check.gst-plugins-good\\..*"
+    # take longer time due to splitmux unit test
+    TIMEOUT_FACTOR: "4"
+  rules:
+    - changes:
+      - "*"
+      - scripts/*
+      - ci/**/*
+      - subprojects/gst-devtools/**/*
+      - subprojects/gstreamer/**/*
+      - subprojects/gst-plugins-base/**/*
+      - subprojects/gst-plugins-good/**/*
+
+valgrind ugly:
+  extends: '.valgrind fedora x86_64'
+  variables:
+    TEST_SUITE: "check.gst-plugins-ugly\\..*"
+  rules:
+    - changes:
+      - "*"
+      - scripts/*
+      - ci/**/*
+      - subprojects/gst-devtools/**/*
+      - subprojects/gstreamer/**/*
+      - subprojects/gst-plugins-base/**/*
+      - subprojects/gst-plugins-good/**/*
+      - subprojects/gst-plugins-ugly/**/*
+
+valgrind bad:
+  extends: '.valgrind fedora x86_64'
+  variables:
+    TEST_SUITE: "check.gst-plugins-bad\\..*"
+  rules:
+    - changes:
+      - "*"
+      - scripts/*
+      - ci/**/*
+      - subprojects/gst-devtools/**/*
+      - subprojects/gstreamer/**/*
+      - subprojects/gst-plugins-base/**/*
+      - subprojects/gst-plugins-good/**/*
+      - subprojects/gst-plugins-bad/**/*
+
+valgrind ges:
+  extends: '.valgrind fedora x86_64'
+  variables:
+    TEST_SUITE: "check.gst-editing-services\\..*"
+  rules:
+    - changes:
+      - "*"
+      - scripts/*
+      - ci/**/*
+      - subprojects/gst-devtools/**/*
+      - subprojects/gstreamer/**/*
+      - subprojects/gst-plugins-base/**/*
+      - subprojects/gst-plugins-good/**/*
+      - subprojects/gst-plugins-bad/**/*
+      - subprojects/gst-editing-services/**/*
+      - subprojects/gst-python/**/*
+
+# ---- Integration ----- #
+
+.documentation:
+  extends: '.build fedora x86_64'
+  variables:
+    MESON_ARGS: *simple_build
+    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:
+  - export PATH=/usr/local/cargo/bin/:/usr/local/bin/:$PATH
+  - export RUSTUP_HOME='/usr/local/rustup'
 
-.local_template: &local_template
-  <<: *local_rules
-  needs:
-    - 'manifest'
+  - 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 ninja -C build subprojects/gst-docs/GStreamer-doc
+  - mv build/subprojects/gst-docs/GStreamer-doc/html documentation/
 
-# Test the build job against the latest build image tag and the local manifest
-build fedora x86_64 local:
-  extends: '.build'
-  stage: 'build'
-  image: "${CI_REGISTRY_IMAGE}/amd64/fedora:latest"
   artifacts:
-    expire_in: '5 days'
     when: always
+    expire_in: "7 days"
     paths:
-      - "manifest.xml"
-      - "gst-build/"
-  <<: *local_template
-
-build cerbero fedora x86_64 local:
-  extends: 'build cerbero fedora x86_64'
-  image: "${CI_REGISTRY_IMAGE}/amd64/cerbero-fedora:latest"
-  <<: *local_template
-
-build cerbero cross-android universal local:
-  extends: 'build cerbero cross-android universal'
-  image: "${CI_REGISTRY_IMAGE}/amd64/cerbero-fedora:latest"
-  <<: *local_template
-
-build cerbero cross win32 local:
-  extends: 'build cerbero cross win32'
-  image: "${CI_REGISTRY_IMAGE}/amd64/cerbero-fedora:latest"
-  <<: *local_template
-
-build cerbero cross win64 local:
-  extends: 'build cerbero cross win64'
-  image: "${CI_REGISTRY_IMAGE}/amd64/cerbero-fedora:latest"
-  <<: *local_template
-
-# Note: dependencies: will be deprecated in the future, but current manual
-# jobs with needs: (even if they are allowed to fail) will leave the pipeline
-# pending.
-.test fedora x86_64 local:
-  image: '${CI_REGISTRY_IMAGE}/amd64/fedora:latest'
-  extends: '.test'
-  <<: *local_rules
-
-check fedora local:
-  extends: '.test fedora x86_64 local'
-  variables:
-    TEST_SUITE: 'check.gst*'
-
-cross-android universal examples local:
-  extends: '.cross-android universal examples'
-  image: "${CI_REGISTRY_IMAGE}/amd64/android:latest"
-  <<: *local_rules
-  dependencies:
-    - 'build cerbero cross-android universal local'
-
-integration testsuites fedora local:
-  extends: '.test fedora x86_64 local'
-  before_script:
-    - rm -f gst-build/build/subprojects/gstreamer-vaapi/gst/vaapi/libgstvaapi.so
-  variables:
-    EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures"
-    TEST_SUITE: "validate ges"
+    - documentation/
+    - plugins-cache-diffs/
+
+#
+# This jobs runs in gstreamer namespace when after the merge into main branch.
+# The produced artifact is later used to automatically update the web page.
+#
+documentation:
+  stage: integrate
+  extends:
+    - '.documentation'
+  needs:
+    - "fedora amd64 docker"
+  rules:
+    - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == "main"'
+
+#
+# This job is run in users namespace to validate documentation before merging
+# MR.
+#
+build documentation:
+  extends:
+    - '.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'
+      when: never
+    - changes:
+      - .gitlab-ci.yml
+      - ci/gitlab/*.py
+      - subprojects/*.wrap
+      - subprojects/gst-docs/**/*
+      - subprojects/gst-devtools/**/*
+      - subprojects/gst-editing-services/**/*
+      - subprojects/gst-libav/**/*
+      - subprojects/gst-omx/**/*
+      - subprojects/gst-plugins-bad/**/*
+      - subprojects/gst-plugins-base/**/*
+      - subprojects/gst-plugins-good/**/*
+      - subprojects/gst-plugins-ugly/**/*
+      - subprojects/gstreamer/**/*
+      - subprojects/gstreamer-vaapi/**/*
+      - subprojects/gst-rtsp-server/**/*
+
+# FIXME: Using trigger: causes permission issues, workaround using old REST API.
+# https://gitlab.com/gitlab-org/gitlab/-/issues/341737
+cerbero trigger:
+  stage: build
+  timeout: '4h'
+  tags:
+    - placeholder-job
+  extends:
+    - '.fedora image'
+    - '.fdo.suffixed-image@fedora'
+  needs:
+    - "trigger"
+    - "fedora amd64 docker"
+  script:
+    - ci/gitlab/trigger_cerbero_pipeline.py
+
+  rules:
+    # Never run post merge
+    - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
+      when: never
+    - changes:
+      - .gitlab-ci.yml
+      - ci/gitlab/*.py
+      - subprojects/gst-devtools/**/*
+      - subprojects/gst-editing-services/**/*
+      - subprojects/gst-libav/**/*
+      - subprojects/gst-plugins-bad/**/*
+      - subprojects/gst-plugins-base/**/*
+      - subprojects/gst-plugins-good/**/*
+      - subprojects/gst-plugins-ugly/**/*
+      - subprojects/gst-python/**/*
+      - subprojects/gstreamer/**/*
+      - subprojects/gst-rtsp-server/**/*
+      - subprojects/gst-examples/**/*