From e1d86c9e5164d0fd58a582eba830d36acd6be4fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pupier?= Date: Thu, 30 Jul 2026 16:32:09 +0200 Subject: [PATCH] CAMEL-24318 - improve regen.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * use multithreads for Maven to improve performance. locally with 22 cores, it divided the time by 2. On GitHub CI, it won't be that much as there is only 4 Cores currently * remove x option from git clean to avoid removing the files which are part of .gitignore, for instance all IDE related files * renamed the build log to avoid overriding the first one and to be able to keep both of them Signed-off-by: Aurélien Pupier --- .github/workflows/main-build.yml | 4 +++- .github/workflows/pr-build-main.yml | 5 ++++- etc/scripts/regen.sh | 14 +++++++------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index 74a0b9a6cdefe..63eb7006b23d3 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -70,7 +70,9 @@ jobs: if: always() with: name: main-build-${{ matrix.java }}.log - path: build.log + path: | + build-regen.log + build-regen-catalog.log - name: Save Atlassian Maven Cache uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 if: always() diff --git a/.github/workflows/pr-build-main.yml b/.github/workflows/pr-build-main.yml index 5f03ef0aa6ba7..35245294967d7 100644 --- a/.github/workflows/pr-build-main.yml +++ b/.github/workflows/pr-build-main.yml @@ -145,7 +145,10 @@ jobs: if: always() with: name: build-${{ matrix.java }}.log - path: build.log + path: | + build.log + build-regen.log + build-regen-catalog.log - name: Save Atlassian Maven Cache uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 if: always() diff --git a/etc/scripts/regen.sh b/etc/scripts/regen.sh index 5f4b75f2a69b0..6e99507207fd9 100755 --- a/etc/scripts/regen.sh +++ b/etc/scripts/regen.sh @@ -22,23 +22,23 @@ set -e cd `dirname "$0"`/../.. # Force clean -git clean -fdx +git clean -fd rm -Rf **/src/generated/ # Regenerate everything -if ./mvnw --batch-mode -Pregen -DskipTests ${MAVEN_EXTRA_ARGS} install >> build.log 2>&1; then +if ./mvnw -T1C --batch-mode -Pregen -DskipTests ${MAVEN_EXTRA_ARGS} install > build-regen.log 2>&1; then echo "✅ mvn -Pregen succeeded." else - echo "❌ mvn -Pregen failed. Last 50 lines of build.log:" - tail -n 50 build.log + echo "❌ mvn -Pregen failed. Last 50 lines of build-regen.log:" + tail -n 50 build-regen.log exit 1 fi # One additional pass to get the info for the 'others' jars -if ./mvnw --batch-mode ${MAVEN_EXTRA_ARGS} install -f catalog/camel-catalog >> build.log 2>&1; then +if ./mvnw --batch-mode ${MAVEN_EXTRA_ARGS} install -f catalog/camel-catalog > build-regen-catalog.log 2>&1; then echo "✅ mvn install for camel-catalog succeeded." else - echo "❌ mvn install for camel-catalog failed. Last 50 lines of build.log:" - tail -n 50 build.log + echo "❌ mvn install for camel-catalog failed. Last 50 lines of build-regen-catalog.log:" + tail -n 50 build-regen-catalog.log exit 1 fi