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

jacopoc pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git

commit ff5bd335b6800036adf8f4d0e9c7a85ebb8ff677
Author: Jacopo Cappellato <[email protected]>
AuthorDate: Tue Oct 20 19:33:59 2026 +0200

    Run the Java CI workflow only when it is useful
    
    The ubuntu-latest runners are a limited resource shared by all the ASF
    projects, so avoid using them when the build cannot be affected:
    
    - trigger the workflow only for changes that can affect
      "gradlew check javadoc": changes to documentation (*.md, *.adoc,
      docs/), Windows scripts, legal/info files, Docker/IDE/devcontainer
      setup and other workflows no longer start a build
    - cancel the build of a pull request that is still running or queued
      when a new commit is pushed to it; builds of pushes to trunk and
      release* branches are never cancelled
    - drop the "prep" job, which used a runner only to compute the JDK
      matrix: the matrix is now computed directly with an expression
      (JDK 17 for release* branches, JDK 17 and 21 otherwise)
    
    Co-Authored-By: Claude Opus 5.5
    (cherry picked from commit 3734acdb57e9a2ade75006eac0206de9ecd1a762)
---
 .github/workflows/gradle.yml | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml
index 4e38fe3f58..6e8f706cbd 100644
--- a/.github/workflows/gradle.yml
+++ b/.github/workflows/gradle.yml
@@ -22,8 +22,45 @@ name: Java CI with Gradle
 on:
   push:
     branches: [ trunk, release* ]
+    # Changes that cannot affect `./gradlew check javadoc` (documentation, 
Docker/IDE/devcontainer
+    # setup, Windows-only scripts, other workflows...) don't trigger the 
build: the ubuntu-latest
+    # runners are a limited resource shared by all the ASF projects.
+    # GitHub evaluates these patterns in order, so a later pattern can 
re-include a path that an
+    # earlier "!" pattern excluded.
+    paths: &build-paths
+      - '**'
+      - '!**.md'
+      - '!**.adoc'
+      - '!**/src/docs/**'
+      - '!docs/**'
+      - '!**.bat'
+      - '!APACHE2_HEADER'
+      - '!INSTALL'
+      - '!LICENSE'
+      - '!NOTICE'
+      - '!OPTIONAL_LIBRARIES'
+      - '!VERSION'
+      - '!.asf.yaml'
+      - '!.devcontainer/**'
+      - '!.dockerignore'
+      - '!.gitattributes'
+      - '!.gitignore'
+      - '!.hgignore'
+      - '!.idea/**'
+      - '!.pre-commit-config.yaml'
+      - '!Dockerfile'
+      - '!docker/**'
+      - '!.github/**'
+      - '.github/workflows/gradle.yml'
   pull_request:
     branches: [ trunk, release* ]
+    paths: *build-paths
+
+# A new push to a pull request makes its previous, still running or queued 
build useless.
+# Pushes to trunk and release* are never cancelled so that every commit gets 
its own result.
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
github.ref }}
+  cancel-in-progress: ${{ github.event_name == 'pull_request' }}
 
 permissions:
   contents: read

Reply via email to