From e2bc4d4748fd1fe414c57eaf132ac7811444f1fd Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Thu, 4 Dec 2025 07:27:15 +0000 Subject: [PATCH 1/2] chore(ci): add main branch build validation and concurrency control Add a new workflow to validate commits pushed to main and LTS branches: - Runs full build and tests on push to main, camel-4.4.x, camel-4.8.x, camel-4.10.x, and camel-4.14.x branches - Tests with both Java 17 and Java 21 - Includes build artifact archival for debugging Add concurrency control to PR workflows to prevent resource waste: - pr-build-main.yml: Cancel in-progress runs when PR is updated - pr-comment.yml: Cancel in-progress runs for same issue - pr-doc-validation.yml: Cancel in-progress runs when PR is updated - depsreview.yaml: Cancel in-progress runs when PR is updated This ensures the main branch is always validated after merges and reduces CI queue times by cancelling obsolete workflow runs. --- .github/workflows/depsreview.yaml | 4 ++ .github/workflows/main-build.yml | 94 +++++++++++++++++++++++++ .github/workflows/pr-build-main.yml | 4 ++ .github/workflows/pr-comment.yml | 7 +- .github/workflows/pr-doc-validation.yml | 4 ++ 5 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/main-build.yml diff --git a/.github/workflows/depsreview.yaml b/.github/workflows/depsreview.yaml index fadc163088a4f..8ec597e41e242 100644 --- a/.github/workflows/depsreview.yaml +++ b/.github/workflows/depsreview.yaml @@ -18,6 +18,10 @@ name: 'Dependency Review' on: [pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml new file mode 100644 index 0000000000000..c68e58cbba4ad --- /dev/null +++ b/.github/workflows/main-build.yml @@ -0,0 +1,94 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name: Main Branch Build + +on: + push: + branches: + - main + - camel-4.4.x + - camel-4.8.x + - camel-4.10.x + - camel-4.14.x + paths-ignore: + - README.md + - SECURITY.md + - NOTICE.txt + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + if: github.repository == 'apache/camel' + runs-on: ubuntu-latest + strategy: + matrix: + java: ['17', '21'] + fail-fast: false + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + - id: install-packages + uses: ./.github/actions/install-packages + - id: install-mvnd + uses: ./.github/actions/install-mvnd + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: ${{ matrix.java }} + cache: 'maven' + - name: Build with Maven + run: ./etc/scripts/regen.sh + - name: Archive build logs + uses: actions/upload-artifact@v4 + if: always() + with: + name: build-jdk-${{ matrix.java }}.log + path: build.log + retention-days: 7 + - name: Check for uncommitted changes + shell: bash + run: | + [[ -z $(git status --porcelain) ]] || { echo 'There are uncommitted changes'; git status; echo; echo; git diff; exit 1; } + - name: Run tests + run: | + ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd -l test.log $MVND_OPTS install -DskipITs + - name: Archive test logs + uses: actions/upload-artifact@v4 + if: always() + with: + name: test-jdk-${{ matrix.java }}.log + path: test.log + retention-days: 7 + - name: Publish Test Results + if: always() + run: | + echo "## Test Results for JDK ${{ matrix.java }}" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + # Count test results + TESTS=$(find . -path '*target/surefire-reports/*.xml' -exec grep -l 'testsuite' {} \; 2>/dev/null | wc -l) + echo "Found test report files: $TESTS" >> $GITHUB_STEP_SUMMARY + diff --git a/.github/workflows/pr-build-main.yml b/.github/workflows/pr-build-main.yml index 9576d9d759a1a..a494840b6058e 100644 --- a/.github/workflows/pr-build-main.yml +++ b/.github/workflows/pr-build-main.yml @@ -29,6 +29,10 @@ on: - Jenkinsfile.* - NOTICE.txt +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + permissions: contents: read diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml index 69c578289368f..7c44909c1704d 100644 --- a/.github/workflows/pr-comment.yml +++ b/.github/workflows/pr-comment.yml @@ -20,7 +20,12 @@ name: PR Comment Build on: issue_comment: types: [created] -permissions: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.issue.number }} + cancel-in-progress: true + +permissions: contents: read jobs: diff --git a/.github/workflows/pr-doc-validation.yml b/.github/workflows/pr-doc-validation.yml index 0901104ff3c81..ef9ed7abbe84d 100644 --- a/.github/workflows/pr-doc-validation.yml +++ b/.github/workflows/pr-doc-validation.yml @@ -23,6 +23,10 @@ on: paths: - '**.adoc' +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + permissions: contents: read From fc99bc2ec0eeff873cd6c2161976120703a77fa1 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Fri, 23 Jan 2026 15:08:16 +0100 Subject: [PATCH 2/2] chore(ci): reduce LTS branches to only the two latest (4.10.x, 4.14.x) Removed camel-4.4.x and camel-4.8.x branches from the main branch build workflow to focus on only the two most recent LTS releases. --- .github/workflows/main-build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index c68e58cbba4ad..212fd81b00f7c 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -21,8 +21,6 @@ on: push: branches: - main - - camel-4.4.x - - camel-4.8.x - camel-4.10.x - camel-4.14.x paths-ignore: