Merge branch 'tizen_gst_1.19.3' into tizen_gst_1.20.0
[platform/upstream/gstreamer.git] / .gitlab-ci.yml
index 356afb5..fc6b716 100644 (file)
@@ -13,6 +13,8 @@ stages:
   - 'integrate'
 
 variables:
+  GIT_DEPTH: 1
+
   # Branch to track for modules that have no ref specified in the manifest
   GST_UPSTREAM_BRANCH: 'main'
   ORC_UPSTREAM_BRANCH: 'master'
@@ -23,9 +25,9 @@ variables:
   # 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:  '2021-10-05.0'
+  FEDORA_TAG:  '2021-12-03.1'
   INDENT_TAG: '2021-10-04.0'
-  WINDOWS_TAG: "2021-10-12.0"
+  WINDOWS_TAG: "2022-01-26.3"
 
   GST_UPSTREAM_REPO: 'gstreamer/gstreamer'
   FDO_UPSTREAM_REPO: 'gstreamer/gstreamer'
@@ -63,6 +65,7 @@ variables:
     -Drtsp_server=enabled
     -Dvaapi=enabled
     -Dsharp=disabled
+    -Dgpl=enabled
 
   MESON_GST_WERROR: >
     -Dgstreamer:werror=true
@@ -85,9 +88,14 @@ 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
@@ -108,25 +116,27 @@ default:
 trigger:
   image: alpine:latest
   stage: 'trigger'
+  variables:
+    GIT_STRATEGY: none
   script:
     - echo "Trigger job done, now running the pipeline."
   rules:
     # If the MR is assigned to the Merge bot, trigger the pipeline automatically
     - if: '$CI_MERGE_REQUEST_ASSIGNEES == "gstreamer-merge-bot"'
+    # Alway run tests post merged
+    - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
     # 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
-    # Alway run tests post merged
-    - if: '$CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
 
 .fedora image:
   variables:
     FDO_DISTRIBUTION_VERSION: '31'
     FDO_REPO_SUFFIX: "$FEDORA_AMD64_SUFFIX"
     FDO_DISTRIBUTION_TAG: "$FEDORA_TAG-$GST_UPSTREAM_BRANCH"
-    FDO_DISTRIBUTION_EXEC: 'DEFAULT_BRANCH=$GST_UPSTREAM_BRANCH bash ci/docker/fedora/prepare.sh'
+    FDO_DISTRIBUTION_EXEC: 'GIT_BRANCH=$CI_COMMIT_REF_NAME GIT_URL=$CI_REPOSITORY_URL bash ci/docker/fedora/prepare.sh'
 
 fedora amd64 docker:
   extends:
@@ -135,6 +145,8 @@ fedora amd64 docker:
   stage: 'build docker'
   needs:
     - "trigger"
+  tags:
+    - 'packet.net'
 
 .gst-indent image:
   variables:
@@ -257,8 +269,10 @@ gst indent:
 # build setup templates
 #
 .build_template: &build
+  - ci/scripts/handle-subprojects-cache.py subprojects/
+  # Update subprojects to respect `.wrap` content
+  - meson subprojects update --reset
   - echo $MESON_ARGS
-
   - meson build/ $MESON_ARGS
   - ninja -C build/
   - ccache --show-stats
@@ -313,14 +327,6 @@ gst indent:
   timeout: '45min'
   variables:
     MESON_ARGS: "${DEFAULT_MESON_ARGS} ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
-  before_script:
-    - export RUSTUP_HOME="/usr/local/rustup"
-    - export CARGO_HOME="/usr/local/cargo"
-    - export PATH="/usr/local/cargo/bin:$PATH"
-
-    - ci/scripts/handle-subprojects-cache.py subprojects/
-    # Update subprojects to respect `.wrap` content
-    - meson subprojects update --reset
   script:
     *build
   after_script:
@@ -330,6 +336,13 @@ gst indent:
     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:
@@ -340,13 +353,6 @@ gst indent:
     - "fedora amd64 docker"
   variables:
     MESON_ARGS: *simple_build
-  rules:
-    - changes:
-        *modules_changes
-    # If this matches, it means the pipeline is running against either the main
-    # or a stable branch, so make it manual
-    - if: '$CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
-      when: manual
 
 build nodebug fedora x86_64:
   extends:
@@ -358,16 +364,6 @@ build nodebug fedora x86_64:
   variables:
     MESON_ARGS: "${DEFAULT_MESON_ARGS} -Dsharp=enabled -Dgstreamer:gst_debug=false -Domx=enabled -Dgst-omx:target=generic ${MESON_BUILDTYPE_ARGS} ${MESON_GST_WERROR}"
 
-build static fedora x86_64:
-  extends: '.build fedora x86_64'
-  variables:
-    MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
-
-build static nodebug fedora x86_64:
-  extends: 'build nodebug fedora x86_64'
-  variables:
-    MESON_BUILDTYPE_ARGS: "--default-library=static -Dintrospection=disabled -Ddoc=disabled"
-
 build clang fedora x86_64:
   extends: '.build fedora x86_64'
   variables:
@@ -392,21 +388,24 @@ build clang fedora x86_64:
       -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:
-    - changes:
-        *modules_changes
     # If this matches, it means the pipeline is running against either the main
     # or a stable branch, so make it manual
-    - if: '$CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
+    - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
       when: manual
-  before_script:
-    - ci/scripts/handle-subprojects-cache.py subprojects/
+    - changes:
+        *modules_changes
   script:
+    - 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 &&
+        meson build $env:MESON_ARGS $env:MESON_CROSS_ARGS &&
         ninja -C build"
   # XXX: Re-enable when uploading stops timing out
   #artifacts:
@@ -414,17 +413,31 @@ build clang fedora x86_64:
   #  when: "always"
   #  paths:
   #    - 'build/meson-logs/'
+  #    - 'vslogs.zip'
 
-build vs2017 amd64:
+build vs2019 amd64:
   extends: '.build windows'
   variables:
     ARCH: 'amd64'
 
-build vs2017 x86:
+build vs2019 x86:
   extends: '.build windows'
   variables:
     ARCH: 'x86'
 
+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'
@@ -434,30 +447,21 @@ build msys2 :
       allow_failure: true
       when: 'manual'
   script:
-    # Make sure powershell exists on errors
+    # 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"
 
-    # For some reason docker build hangs if this is included in the image, needs more troubleshooting
-    - $env:PATH += ';C:\msys64\usr\bin;C:\msys64\mingw64\bin;C:\msys64\mingw32\bin'
-    # Copied from https://github.com/msys2/setup-msys2/blob/master/main.js#L98
-    - C:\msys64\usr\bin\bash -c "pacman-key --init && pacman-key --populate msys2 && pacman-key --refresh-keys || true"
-    - C:\msys64\usr\bin\bash -c "sed -i 's/^CheckSpace/#CheckSpace/g' /etc/pacman.conf"
-    - echo "Updating MSYS2"
-    - C:\msys64\usr\bin\bash -c "pacman -Syuu --noconfirm || echo Update failed, ignoring"
-    - echo "Killing all MSYS2 processes"
-    - taskkill /F /FI "MODULES eq msys-2.0.dll"
-    - echo "Completing MSYS2 update"
-    - C:\msys64\usr\bin\bash -c "pacman -Suu --noconfirm"
-    - echo "Installing needed MSYS2 packages"
-    - C:\msys64\usr\bin\bash -c "pacman -Sy --noconfirm --needed mingw-w64-x86_64-toolchain ninja"
-
+    # 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 -c "meson build $env:MESON_ARGS && ninja -C build"
+    - C:\msys64\usr\bin\bash -lc "meson build $env:MESON_ARGS && ninja -C build"
 
 # ---- Tests ----- #
 
@@ -489,6 +493,7 @@ build msys2 :
     - >
       ./gst-env.py
       gst-validate-launcher ${TEST_SUITE}
+      --check-bugs
       --dump-on-failure
       --mute
       --shuffle
@@ -529,29 +534,18 @@ integration testsuites fedora:
   extends: '.test fedora x86_64'
   parallel: 4
   variables:
-    EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --check-bugs --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX} --sync"
+    EXTRA_VALIDATE_ARGS: "--timeout-factor=2 --retry-on-failures --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX} --sync"
     TEST_SUITE: "validate ges"
 
 # gstreamer-full:
-# introspection has been disabled as the static build does not support it.
-# See https://gitlab.freedesktop.org/gstreamer/gst-build/-/issues/162
-gstreamer-full:
-  extends: 'build static fedora x86_64'
-  stage: integrate
+gstreamer-full static build:
+  extends: '.build fedora x86_64'
+  stage: 'build'
   variables:
     MESON_ARGS: >
       --default-library=static
-      -Dintrospection=disabled
+      -Ddoc=disabled
       $MESON_GST_WERROR
-  rules:
-    - changes:
-      - "*"
-      - scripts/*
-      - ci/**/*
-    # If this matches, it means the pipeline is running against either the main
-    # or a stable branch, so make it manual
-    - if: '$CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
-      when: manual
 
   script:
   - *build
@@ -562,12 +556,14 @@ gstreamer-full:
     paths:
       - 'meson-logs/'
 
-gstreamer-full-minimal:
-  extends: 'build static fedora x86_64'
-  stage: integrate
+gstreamer-full-minimal static build:
+  extends: 'gstreamer-full static build'
+  stage: 'build'
   variables:
     MESON_ARGS: >
       --default-library=static
+      -Ddoc=disabled
+      -Dgstreamer:gst_debug=false
       -Dauto_features=disabled
       -Dgstreamer:check=enabled
       -Dtests=enabled
@@ -601,10 +597,8 @@ gstreamer-full-minimal:
 
 valgrind core:
   extends: '.valgrind fedora x86_64'
-  parallel: 2
   variables:
     TEST_SUITE: "check.gstreamer\\..*"
-    EXTRA_VALIDATE_ARGS: "--valgrind --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX}"
   rules:
     - changes:
       - "*"
@@ -615,10 +609,8 @@ valgrind core:
 
 valgrind base:
   extends: '.valgrind fedora x86_64'
-  parallel: 4
   variables:
     TEST_SUITE: "check.gst-plugins-base\\..*"
-    EXTRA_VALIDATE_ARGS: "--valgrind --parts=${CI_NODE_TOTAL} --part-index=${CI_NODE_INDEX}"
   rules:
     - changes:
       - "*"
@@ -701,9 +693,13 @@ valgrind ges:
     MESON_BUILDTYPE_ARGS: "-Ddoc=enabled"
     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
   - ./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
   - mv build/subprojects/gst-docs/GStreamer-doc/html documentation/
@@ -716,7 +712,7 @@ valgrind ges:
     - plugins-cache-diffs/
 
 #
-# This jobs runs in gsrtreamer namespace when after the merge into main branch.
+# 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:
@@ -738,6 +734,9 @@ build documentation:
   needs:
     - "trigger"
   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/freedesktop_doc_importer.sh
@@ -754,8 +753,6 @@ build documentation:
       - subprojects/gstreamer/**/*
       - subprojects/gstreamer-vaapi/**/*
       - subprojects/gst-rtsp-server/**/*
-    - if: '$CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
-      when: never
 
 # FIXME: Using trigger: causes permission issues, workaround using old REST API.
 # https://gitlab.com/gitlab-org/gitlab/-/issues/341737
@@ -770,6 +767,9 @@ cerbero trigger:
     - 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/trigger_cerbero_pipeline.py
@@ -784,5 +784,3 @@ cerbero trigger:
       - subprojects/gstreamer/**/*
       - subprojects/gst-rtsp-server/**/*
       - subprojects/gst-examples/**/*
-    - if: '$CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
-      when: never