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

asf-gitbox-commits pushed a commit to branch UNOMI-966-setup-java-v5
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/UNOMI-966-setup-java-v5 by 
this push:
     new a538a91ba UNOMI-966: Speed up and harden CI workflows
a538a91ba is described below

commit a538a91bac6fd7333eb4f99a69676f4f461e6dba
Author: Serge Huber <[email protected]>
AuthorDate: Fri Jul 17 17:58:15 2026 +0200

    UNOMI-966: Speed up and harden CI workflows
    
    - Add cache: maven to CodeQL Java build and both docs-deploy jobs
    - Purge Unomi's own snapshots from ~/.m2 before every post-job cache
      save (all cached jobs) so caches hold only third-party dependencies
    - Add concurrency groups: cancel superseded PR runs, never cancel
      master/scheduled runs; serialize (not cancel) snapshot deploys
    - Remove dead Nexus server config from the Docker image job
    - Quote distribution/java-version consistently with other workflows
    
    Co-Authored-By: Claude Fable 5 <[email protected]>
---
 .github/workflows/codeql-analysis-java.yml       | 16 ++++++++++++--
 .github/workflows/codeql-analysis-javascript.yml |  5 +++++
 .github/workflows/unomi-ci-build-tests.yml       | 15 +++++++++++++
 .github/workflows/unomi-ci-docs-deploy.yml       | 28 ++++++++++++++++++------
 .github/workflows/unomi-ci-docs.yml              | 13 ++++++++++-
 5 files changed, 67 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/codeql-analysis-java.yml 
b/.github/workflows/codeql-analysis-java.yml
index 435e05066..7429ef98f 100644
--- a/.github/workflows/codeql-analysis-java.yml
+++ b/.github/workflows/codeql-analysis-java.yml
@@ -24,6 +24,11 @@ on:
 env:
   DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
 
+# Cancel superseded runs on the same PR, but never cancel master/scheduled runs
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+
 jobs:
   analyze:
     name: Analyze
@@ -46,10 +51,17 @@ jobs:
     - name: Set up JDK 17
       uses: actions/setup-java@v5
       with:
-        distribution: temurin
-        java-version: 17
+        distribution: 'temurin'
+        java-version: '17'
+        cache: 'maven'
     - run: mvn -U -ntp -e clean install -DskipTests
 
+    # Keep only third-party dependencies in the post-job Maven cache: Unomi's 
own
+    # snapshots are rebuilt every run and would only bloat the cache / risk 
staleness
+    - name: Clean Unomi artifacts from Maven cache
+      if: always()
+      run: rm -rf ~/.m2/repository/org/apache/unomi
+
     - name: Perform CodeQL Analysis
       uses: github/codeql-action/analyze@v3
       with:
diff --git a/.github/workflows/codeql-analysis-javascript.yml 
b/.github/workflows/codeql-analysis-javascript.yml
index 50d7ad3df..b1b055cc7 100644
--- a/.github/workflows/codeql-analysis-javascript.yml
+++ b/.github/workflows/codeql-analysis-javascript.yml
@@ -21,6 +21,11 @@ on:
   schedule:
     - cron: '38 1 * * 0'
 
+# Cancel superseded runs on the same PR, but never cancel master/scheduled runs
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+
 jobs:
   analyze:
     name: Analyze
diff --git a/.github/workflows/unomi-ci-build-tests.yml 
b/.github/workflows/unomi-ci-build-tests.yml
index 109ef1433..076ab448e 100644
--- a/.github/workflows/unomi-ci-build-tests.yml
+++ b/.github/workflows/unomi-ci-build-tests.yml
@@ -12,6 +12,11 @@ on:
 env:
   DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
 
+# Cancel superseded runs on the same PR, but never cancel master runs
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+
 jobs:
   unit-tests:
     name: Execute unit tests
@@ -32,6 +37,11 @@ jobs:
         dot -V
     - name: Build and Unit tests
       run: ./build.sh --ci
+    # Keep only third-party dependencies in the post-job Maven cache: Unomi's 
own
+    # snapshots are rebuilt every run and would only bloat the cache / risk 
staleness
+    - name: Clean Unomi artifacts from Maven cache
+      if: always()
+      run: rm -rf ~/.m2/repository/org/apache/unomi
 
   integration-tests:
     name: Execute integration tests
@@ -70,6 +80,11 @@ jobs:
           else
             ./build.sh --ci --integration-tests
           fi
+      # Keep only third-party dependencies in the post-job Maven cache: 
Unomi's own
+      # snapshots are rebuilt every run and would only bloat the cache / risk 
staleness
+      - name: Clean Unomi artifacts from Maven cache
+        if: always()
+        run: rm -rf ~/.m2/repository/org/apache/unomi
       - name: Archive IT memory metrics
         uses: actions/upload-artifact@v6
         if: always()
diff --git a/.github/workflows/unomi-ci-docs-deploy.yml 
b/.github/workflows/unomi-ci-docs-deploy.yml
index 672dcd2be..f53bc44fd 100644
--- a/.github/workflows/unomi-ci-docs-deploy.yml
+++ b/.github/workflows/unomi-ci-docs-deploy.yml
@@ -10,6 +10,11 @@ on:
 env:
   DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
 
+# Serialize deploys from consecutive master pushes; never cancel a publish 
mid-run
+concurrency:
+  group: ${{ github.workflow }}
+  cancel-in-progress: false
+
 jobs:
   publish-docs-and-snapshots:
     name: Publish Javadoc and snapshots
@@ -19,8 +24,9 @@ jobs:
       - name: Set up JDK 17
         uses: actions/setup-java@v5
         with:
-          distribution: temurin
-          java-version: 17
+          distribution: 'temurin'
+          java-version: '17'
+          cache: 'maven'
           server-id: apache.snapshots.https
           server-username: NEXUS_USER
           server-password: NEXUS_PW
@@ -36,6 +42,11 @@ jobs:
         env:
           NEXUS_USER: ${{ secrets.NEXUS_USER }}
           NEXUS_PW: ${{ secrets.NEXUS_PW }}
+      # Keep only third-party dependencies in the post-job Maven cache: 
Unomi's own
+      # snapshots are rebuilt every run and would only bloat the cache / risk 
staleness
+      - name: Clean Unomi artifacts from Maven cache
+        if: always()
+        run: rm -rf ~/.m2/repository/org/apache/unomi
 
   publish-docker-image:
     name: Push Docker image snapshot
@@ -45,10 +56,13 @@ jobs:
       - name: Set up JDK 17
         uses: actions/setup-java@v5
         with:
-          distribution: temurin
-          java-version: 17
-          server-id: apache.snapshots.https
-          server-username: NEXUS_USER
-          server-password: NEXUS_PW
+          distribution: 'temurin'
+          java-version: '17'
+          cache: 'maven'
       - name: Building & pushing Docker snapshot image
         run: mvn -ntp clean install -P docker; pushd docker; mvn 
-Ddocker.username=${{ secrets.DOCKERHUB_USER }} -Ddocker.password=${{ 
secrets.DOCKERHUB_TOKEN }} docker:push; popd
+      # Keep only third-party dependencies in the post-job Maven cache: 
Unomi's own
+      # snapshots are rebuilt every run and would only bloat the cache / risk 
staleness
+      - name: Clean Unomi artifacts from Maven cache
+        if: always()
+        run: rm -rf ~/.m2/repository/org/apache/unomi
diff --git a/.github/workflows/unomi-ci-docs.yml 
b/.github/workflows/unomi-ci-docs.yml
index 01ff8833c..3fe290880 100644
--- a/.github/workflows/unomi-ci-docs.yml
+++ b/.github/workflows/unomi-ci-docs.yml
@@ -9,6 +9,11 @@ on:
       - 'manual/**'
       - '.github/workflows/unomi-ci-docs.yml'
 
+# Cancel superseded runs on the same PR, but never cancel master runs
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+
 jobs:
   build-docs:
     name: Build Documentation
@@ -33,7 +38,13 @@ jobs:
         run: |
           cd manual
           mvn -U -ntp clean install
-      
+
+      # Keep only third-party dependencies in the post-job Maven cache: 
Unomi's own
+      # snapshots are rebuilt every run and would only bloat the cache / risk 
staleness
+      - name: Clean Unomi artifacts from Maven cache
+        if: always()
+        run: rm -rf ~/.m2/repository/org/apache/unomi
+
       - name: Archive documentation
         uses: actions/upload-artifact@v6
         with:

Reply via email to