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

jbonofre pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-java.git


The following commit(s) were added to refs/heads/main by this push:
     new 7f1f9f588 GH-1188: Reduce test workflow waste (#1189)
7f1f9f588 is described below

commit 7f1f9f588af610b842ee1c3bccf6afbd528ae4db
Author: Hélder Gregório <[email protected]>
AuthorDate: Thu Jul 9 14:42:25 2026 +0100

    GH-1188: Reduce test workflow waste (#1189)
    
    ## Summary
    
    This PR reduces wasted GitHub Actions time in the `Test` workflow by
    removing redundant rebuilds, improving caching, and skipping integration
    work when it is not relevant.
    
    ## What changed
    
    - Removed `clean` from `ci/scripts/test.sh` so the test phase reuses the
    classes compiled earlier in the job instead of deleting and recompiling
    them.
    - Narrowed the Maven/Docker cache key to POM changes, so source-only
    edits do not invalidate the dependency cache.
    - Enabled Maven dependency caching on the macOS and Windows test jobs.
    - Added `pull-requests: read` so the integration job can inspect changed
    files.
    
    Closes #1188
    
    Note: The changes on this PR were highlighted and addressed with AI
    assistance
---
 .github/workflows/test.yml | 24 +++++++++++++-----------
 ci/scripts/test.sh         |  7 ++++---
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index ac8080d07..41a42c05e 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -66,7 +66,7 @@ jobs:
         uses: actions/cache@v6
         with:
           path: .docker
-          key: maven-${{ matrix.jdk }}-${{ matrix.maven }}-${{ 
hashFiles('compose.yaml', '**/pom.xml', '**/*.java') }}
+          key: maven-${{ matrix.jdk }}-${{ matrix.maven }}-${{ 
hashFiles('compose.yaml', '**/pom.xml') }}
           restore-keys: maven-${{ matrix.jdk }}-${{ matrix.maven }}-
       - name: Execute Docker Build
         env:
@@ -94,16 +94,17 @@ jobs:
             jdk: 17
             macos: latest
     steps:
-      - name: Set up Java
-        uses: actions/setup-java@v5
-        with:
-          distribution: 'temurin'
-          java-version: ${{ matrix.jdk }}
       - name: Checkout Arrow
         uses: actions/checkout@v7
         with:
           fetch-depth: 0
           submodules: recursive
+      - name: Set up Java
+        uses: actions/setup-java@v5
+        with:
+          distribution: 'temurin'
+          java-version: ${{ matrix.jdk }}
+          cache: 'maven'
       - name: Build
         shell: bash
         env:
@@ -125,16 +126,17 @@ jobs:
       matrix:
         jdk: [17]
     steps:
-      - name: Set up Java
-        uses: actions/setup-java@v5
-        with:
-          java-version: ${{ matrix.jdk }}
-          distribution: 'temurin'
       - name: Checkout Arrow
         uses: actions/checkout@v7
         with:
           fetch-depth: 0
           submodules: recursive
+      - name: Set up Java
+        uses: actions/setup-java@v5
+        with:
+          java-version: ${{ matrix.jdk }}
+          distribution: 'temurin'
+          cache: 'maven'
       - name: Build
         shell: bash
         env:
diff --git a/ci/scripts/test.sh b/ci/scripts/test.sh
index cacc20034..8061ee455 100755
--- a/ci/scripts/test.sh
+++ b/ci/scripts/test.sh
@@ -34,10 +34,11 @@ fi
 mvn="mvn -B 
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
 # Use `2 * ncores` threads
 mvn="${mvn} -T 2C"
+mvn="${mvn} -Denforcer.skip=true"
 
 pushd "${build_dir}"
 
-${mvn} -Darrow.test.dataRoot="${source_dir}/testing/data" clean test
+${mvn} -Darrow.test.dataRoot="${source_dir}/testing/data" test
 
 projects=()
 if [ "${ARROW_JAVA_JNI}" = "ON" ]; then
@@ -46,7 +47,7 @@ if [ "${ARROW_JAVA_JNI}" = "ON" ]; then
   projects+=(gandiva)
 fi
 if [ "${#projects[@]}" -gt 0 ]; then
-  ${mvn} clean test \
+  ${mvn} test \
     -Parrow-jni \
     -pl "$(
       IFS=,
@@ -56,7 +57,7 @@ if [ "${#projects[@]}" -gt 0 ]; then
 fi
 
 if [ "${ARROW_JAVA_CDATA}" = "ON" ]; then
-  ${mvn} clean test -Parrow-c-data -pl c 
-Darrow.c.jni.dist.dir="${java_jni_dist_dir}"
+  ${mvn} test -Parrow-c-data -pl c 
-Darrow.c.jni.dist.dir="${java_jni_dist_dir}"
 fi
 
 popd

Reply via email to