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..212fd81b00f7c --- /dev/null +++ b/.github/workflows/main-build.yml @@ -0,0 +1,92 @@ +# +# 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.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 b776183b8df87..0d45a9cc720d9 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 666d6deb21e95..8c574d834a924 100644 --- a/.github/workflows/pr-comment.yml +++ b/.github/workflows/pr-comment.yml @@ -20,6 +20,11 @@ name: PR Comment Build on: issue_comment: types: [created] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.issue.number }} + cancel-in-progress: true + permissions: contents: read 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