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/05/30 17:50:22 UTC

[camel] branch main updated: Add more log message to the component-test action (#10244)

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 eefe140478b Add more log message to the component-test action (#10244)
eefe140478b is described below

commit eefe140478ba8a638109aabd2e55fc667e41cdb5
Author: Nicolas Filotto <es...@users.noreply.github.com>
AuthorDate: Tue May 30 19:50:14 2023 +0200

    Add more log message to the component-test action (#10244)
    
    Modifications:
    
    * Add more log messages to ease debugging
    * Limit the most to trigger the workflow by adding more tests
    * Checkout the current branch instead of the head
---
 .github/actions/component-test/component-test.sh |  3 +++
 .github/workflows/pr-comment-main.yml            | 10 ++++------
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/.github/actions/component-test/component-test.sh b/.github/actions/component-test/component-test.sh
index 54fd13218d7..4236dc12a61 100755
--- a/.github/actions/component-test/component-test.sh
+++ b/.github/actions/component-test/component-test.sh
@@ -27,6 +27,7 @@ function main() {
 
   if [[ ${commentBody} = /component-test* ]] ; then
     local componentList="${commentBody:16}"
+    echo "The list of components to test is ${componentList}"
   else
     echo "No components has been detected, the expected format is '/component-test (camel-)component-name1 (camel-)component-name2...'"
     exit 1
@@ -43,8 +44,10 @@ function main() {
   pl="${pl:1}"
 
   if [[ ${fastBuild} = "true" ]] ; then
+    echo "Launching a fast build against the projects ${pl} and their dependencies"
     $mavenBinary -l $log -Dmvnd.threads=2 -V -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 --no-transfer-progress -e -Pfastinstall install -pl "$pl" -am
   else
+    echo "Launching tests of the projects ${pl}"
     $mavenBinary -l $log -Dmvnd.threads=2 -V -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 --no-transfer-progress -e install -pl "$pl"
   fi
 }
diff --git a/.github/workflows/pr-comment-main.yml b/.github/workflows/pr-comment-main.yml
index 680c619d1ff..ff5647f622d 100644
--- a/.github/workflows/pr-comment-main.yml
+++ b/.github/workflows/pr-comment-main.yml
@@ -15,15 +15,15 @@
 # limitations under the License.
 #
 
-name: PR Comment Build (Camel 4)
+name: PR Comment Build
 
 on:
   issue_comment:
-
+    types: [created]
 jobs:
   pr_commented:
     name: PR comment
-    if: ${{ github.event.issue.pull_request }}
+    if: ${{ github.event.issue.pull_request }} && contains(github.event.comment.body, '/component-test')
     permissions:
       issues: write
     runs-on: ubuntu-latest
@@ -32,13 +32,11 @@ jobs:
         java: [ '17' ]
     steps:
       - name: check for component tests
-        if: contains(github.event.comment.body, '/component-test')
         run: |
           echo Component tests have been requested
       - uses: actions/checkout@v3
         with:
-          persist-credentials: false
-          fetch-depth: 0
+          ref: ${{ github.ref }}
       - id: install-packages
         uses: ./.github/actions/install-packages
       - name: Set up JDK ${{ matrix.java }}