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

ruanwenjun pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 5c85e15a8b [Chore] Unit-Test performance optimize (#18213)
5c85e15a8b is described below

commit 5c85e15a8b96d4449c53c0260a72e3ae59c81253
Author: xiangzihao <[email protected]>
AuthorDate: Sat May 2 20:22:45 2026 +0800

    [Chore] Unit-Test performance optimize (#18213)
---
 .github/workflows/unit-test.yml | 28 ++++++++++++++++++++++------
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml
index 0afb995a98..faec09b8fd 100644
--- a/.github/workflows/unit-test.yml
+++ b/.github/workflows/unit-test.yml
@@ -52,6 +52,8 @@ jobs:
   sanity-check:
     name: Sanity Check
     runs-on: ubuntu-latest
+    needs: paths-filter
+    if: ${{ needs.paths-filter.outputs.not-ignore == 'true' || 
github.event_name == 'push' }}
     steps:
       - uses: actions/checkout@v6
         with:
@@ -64,6 +66,8 @@ jobs:
   generate-matrix:
     name: Generate Module Matrix
     runs-on: ubuntu-latest
+    needs: paths-filter
+    if: ${{ needs.paths-filter.outputs.not-ignore == 'true' || 
github.event_name == 'push' }}
     outputs:
       matrix: ${{ steps.set-matrix.outputs.matrix }}
     steps:
@@ -124,16 +128,28 @@ jobs:
           key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}-backend
           restore-keys: ${{ runner.os }}-maven-
 
-      # Use -am (--also-make) so Maven automatically builds all upstream
-      # dependency modules before running tests in the target module.
-      # -DskipTests=true skips tests in dependency modules; only the
-      # target module (-pl) runs its unit tests via verify.
+      # Install the target module and its upstream dependencies into the local
+      # Maven repository without running tests. The following unit-test step
+      # resolves these artifacts from the same runner's ~/.m2/repository.
+      - name: Install Dependencies (${{ matrix.module }})
+        run: |
+          export MAVEN_OPTS="-Xmx14g -XX:MetaspaceSize=256m 
-XX:MaxMetaspaceSize=1024m"
+          ./mvnw install -B \
+            -pl "${{ matrix.module }}" \
+            -am \
+            -Dmaven.test.skip=true \
+            -Dspotless.skip=true \
+            -DskipUT=true \
+            -Djacoco.skip=true \
+            -Danalyze.skip=true
+
+      # Verify only the target module. Do not use -am here, otherwise Maven
+      # will run the verify lifecycle for dependency modules too.
       - name: Run Unit Tests (${{ matrix.module }})
         run: |
-          export MAVEN_OPTS="-Xmx8g -XX:MetaspaceSize=256m 
-XX:MaxMetaspaceSize=1024m"
+          export MAVEN_OPTS="-Xmx14g -XX:MetaspaceSize=256m 
-XX:MaxMetaspaceSize=1024m"
           ./mvnw verify -B \
             -pl "${{ matrix.module }}" \
-            -am \
             -Dmaven.test.skip=false \
             -Dspotless.skip=true \
             -DskipUT=false \

Reply via email to