You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2023/10/13 15:44:07 UTC

[camel] branch main updated: (chore) ci: auto-generate list of submodules (#11720)

This is an automated email from the ASF dual-hosted git repository.

nfilotto pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 0ad23eca47a (chore) ci: auto-generate list of submodules (#11720)
0ad23eca47a is described below

commit 0ad23eca47ab6e82200d91d479de3ebb0ab8a15a
Author: Nicolas Filotto <es...@users.noreply.github.com>
AuthorDate: Fri Oct 13 17:44:00 2023 +0200

    (chore) ci: auto-generate list of submodules (#11720)
    
    ## Motivation
    
    When we have a component that has submodules, for now, we need to specify explicitly the list of submodules to test when using the GH `component-test` which leads to https://github.com/apache/camel/pull/11716#issuecomment-1761062508. Let's try to generate the list.
    
    ## Modifications
    
    * Auto-detect the pom files in subdirectories and include their directory to the list of projects to test
    * Support the use case where the provided component name is incorrect
---
 .github/actions/component-test/component-test.sh | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/.github/actions/component-test/component-test.sh b/.github/actions/component-test/component-test.sh
index 68efe60e73a..282b06a1a84 100755
--- a/.github/actions/component-test/component-test.sh
+++ b/.github/actions/component-test/component-test.sh
@@ -34,12 +34,21 @@ function main() {
   for component in ${componentList}
   do
     if [[ ${component} = camel-* ]] ; then
-      pl="$pl,components/${component}"
+      componentPath="components/${component}"
     else
-      pl="$pl,components/camel-${component}"
+      componentPath="components/camel-${component}"
+    fi
+    if [[ -d "${componentPath}" ]] ; then
+      pl="$pl$(find "${componentPath}" -name pom.xml -exec dirname {} \; | sort | tr -s "\n" ",")"
     fi
   done
-  pl="${pl:1}"
+  len=${#pl}
+  if [[ "$len" -gt "0" ]] ; then
+    pl="${pl::len-1}"
+  else
+    echo "The components to test don't exist"
+    exit 1
+  fi
 
   if [[ ${fastBuild} = "true" ]] ; then
     echo "Launching a fast build against the projects ${pl} and their dependencies"