Use new `libraries` subprojects variables to statically link then
[platform/upstream/gstreamer.git] / .gitlab-ci.yml
index 597c0b6..a1bf171 100644 (file)
@@ -1,5 +1,4 @@
 include:
-  - remote: "https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/14731f78c23c7b523a85a26a068ade9ac1ecd2f3/templates/ci-fairy.yml"
   - 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"
 
@@ -24,9 +23,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-04.0'
+  FEDORA_TAG:  '2021-10-05.0'
   INDENT_TAG: '2021-10-04.0'
-  WINDOWS_TAG: "2021-10-04.0"
+  WINDOWS_TAG: "2021-10-12.0"
 
   GST_UPSTREAM_REPO: 'gstreamer/gstreamer'
   FDO_UPSTREAM_REPO: 'gstreamer/gstreamer'
@@ -114,15 +113,13 @@ trigger:
   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
-    # 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'
 
 .fedora image:
   variables:
@@ -136,6 +133,8 @@ fedora amd64 docker:
     - '.fedora image'
     - '.fdo.container-build@fedora'
   stage: 'build docker'
+  needs:
+    - "trigger"
 
 .gst-indent image:
   variables:
@@ -255,18 +254,6 @@ gst indent:
       fi
 
 #
-# Check "allow-edit" checkbox on merge requests with ci-fairy
-#
-check allow-edit:
-  extends: '.fdo.ci-fairy'
-  needs: []
-  stage: 'preparation'
-  script:
-    - ci-fairy check-merge-request --require-allow-collaboration
-  rules:
-    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
-
-#
 # build setup templates
 #
 .build_template: &build
@@ -343,6 +330,13 @@ check allow-edit:
     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:
@@ -353,9 +347,6 @@ check allow-edit:
     - "fedora amd64 docker"
   variables:
     MESON_ARGS: *simple_build
-  rules:
-    - changes:
-        *modules_changes
 
 build nodebug fedora x86_64:
   extends:
@@ -402,6 +393,10 @@ build clang fedora x86_64:
       -Dgst-plugins-base:pango=enabled
       -Dgst-plugins-good:cairo=enabled
   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
   before_script:
@@ -443,26 +438,17 @@ build msys2 :
     # 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 ----- #
 
@@ -494,6 +480,7 @@ build msys2 :
     - >
       ./gst-env.py
       gst-validate-launcher ${TEST_SUITE}
+      --check-bugs
       --dump-on-failure
       --mute
       --shuffle
@@ -534,7 +521,7 @@ 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}"
+    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:
@@ -549,10 +536,14 @@ gstreamer-full:
       -Dintrospection=disabled
       $MESON_GST_WERROR
   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:
       - "*"
       - scripts/*
-      - subprojects/gst-ci/**/*
+      - ci/**/*
 
   script:
   - *build
@@ -580,8 +571,6 @@ gstreamer-full-minimal:
       -Dgst-full-device-providers=alsa:alsadeviceprovider
       -Dgst-full-dynamic-types=pbtypes:video_multiview_flagset
       $MESON_GST_WERROR
-  rules:
-    - if: '$CI_PROJECT_NAME =~ /^(gst-build|gst-ci)$/'
 
   script:
   - *build
@@ -604,25 +593,29 @@ 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:
       - "*"
       - scripts/*
-      - subprojects/gst-ci/**/*
+      - ci/**/*
       - subprojects/gst-devtools/**/*
       - subprojects/gstreamer/**/*
 
 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:
       - "*"
       - scripts/*
-      - subprojects/gst-ci/**/*
+      - ci//**/*
       - subprojects/gst-devtools/**/*
       - subprojects/gstreamer/**/*
       - subprojects/gst-plugins-base/**/*
@@ -637,7 +630,7 @@ valgrind good:
     - changes:
       - "*"
       - scripts/*
-      - subprojects/gst-ci/**/*
+      - ci/**/*
       - subprojects/gst-devtools/**/*
       - subprojects/gstreamer/**/*
       - subprojects/gst-plugins-base/**/*
@@ -651,7 +644,7 @@ valgrind ugly:
     - changes:
       - "*"
       - scripts/*
-      - subprojects/gst-ci/**/*
+      - ci/**/*
       - subprojects/gst-devtools/**/*
       - subprojects/gstreamer/**/*
       - subprojects/gst-plugins-base/**/*
@@ -666,7 +659,7 @@ valgrind bad:
     - changes:
       - "*"
       - scripts/*
-      - subprojects/gst-ci/**/*
+      - ci/**/*
       - subprojects/gst-devtools/**/*
       - subprojects/gstreamer/**/*
       - subprojects/gst-plugins-base/**/*
@@ -681,7 +674,7 @@ valgrind ges:
     - changes:
       - "*"
       - scripts/*
-      - subprojects/gst-ci/**/*
+      - ci/**/*
       - subprojects/gst-devtools/**/*
       - subprojects/gstreamer/**/*
       - subprojects/gst-plugins-base/**/*
@@ -715,7 +708,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:
@@ -736,9 +729,10 @@ build documentation:
   stage: build
   needs:
     - "trigger"
-
-  stage: build
   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
@@ -760,21 +754,21 @@ build documentation:
 # https://gitlab.com/gitlab-org/gitlab/-/issues/341737
 cerbero trigger:
   stage: build
-  image: $FEDORA_IMAGE
+  extends:
+    - '.fedora image'
+    - '.fdo.suffixed-image@fedora'
   needs:
     - "fedora amd64 docker"
   script:
-    - python3 -m pip install --user python-gitlab
     - ci/gitlab/trigger_cerbero_pipeline.py
 
-  variables:
-    # Use GST_UPSTREAM_BRANCH
-    UPSTREAM_BRANCH: 'main'
-
   rules:
+    # Never run post merge
+    - if: '$CI_PROJECT_NAMESPACE == "gstreamer" && $CI_COMMIT_BRANCH == $GST_UPSTREAM_BRANCH'
+      when: never
     - changes:
       - .gitlab-ci.yml
-      - ci/gitlab/tigger_cerbero_pipeline.py
+      - ci/gitlab/trigger_cerbero_pipeline.py
       - subprojects/gst-devtools/**/*
       - subprojects/gst-editing-services/**/*
       - subprojects/gst-libav/**/*