Skip to content

Proposal for OpenTelemetry2 baggage management #16835

Proposal for OpenTelemetry2 baggage management

Proposal for OpenTelemetry2 baggage management #16835

Workflow file for this run

#
# 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: Build and test
on:
pull_request:
branches:
- main
# CI-only changes don't need a full build. Use workflow_dispatch to
# test CI changes: gh workflow run "Build and test" -f pr_number=XXXX -f pr_ref=branch-name
paths-ignore:
- .github/**
- README.md
- SECURITY.md
- Jenkinsfile
- Jenkinsfile.*
- NOTICE.txt
workflow_dispatch:
inputs:
pr_number:
description: 'Pull request number to build'
required: true
type: string
pr_ref:
description: 'Git ref of the pull request branch'
required: true
type: string
extra_modules:
description: 'Additional modules to test (comma-separated paths, e.g. from /component-test)'
required: false
type: string
default: ''
skip_full_build:
description: 'Skip full regen build — use quick targeted build instead (for /component-test)'
required: false
type: boolean
default: false
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || inputs.pr_number || github.ref }}${{ inputs.extra_modules && '-component-test' || '' }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
if: github.repository == 'apache/camel'
permissions:
contents: read
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
java: ['17', '21']
experimental: [ false ]
include:
- java: '17'
# JDK 17 is kept for runtime compatibility testing.
# Skip the enforcer which requires JDK 21+ (needed to compile JDK 21-specific classes).
maven_extra_args: '-Denforcer.phase=none'
- java: '25'
experimental: true
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
ref: ${{ inputs.pr_ref || '' }}
- 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@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
cache: 'maven'
- name: maven build
if: ${{ !inputs.skip_full_build }}
env:
MAVEN_EXTRA_ARGS: ${{ matrix.maven_extra_args || '' }}
run: ./etc/scripts/regen.sh
- name: Quick dependency build
if: ${{ inputs.skip_full_build }}
shell: bash
env:
EXTRA_MODULES: ${{ inputs.extra_modules }}
MAVEN_EXTRA_ARGS: ${{ matrix.maven_extra_args || '' }}
run: ./mvnw -l build.log install -B -DskipTests -Dquickly $MAVEN_EXTRA_ARGS -pl "$EXTRA_MODULES" -am
- name: archive logs
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: build-${{ matrix.java }}.log
path: build.log
- name: Fail if there are uncommitted changes
if: ${{ !inputs.skip_full_build }}
shell: bash
run: |
[[ -z $(git status --porcelain) ]] || { echo 'There are uncommitted changes'; git status; echo; echo; git diff; exit 1; }
- name: mvn test
uses: ./.github/actions/incremental-build
with:
pr-id: ${{ github.event.number || inputs.pr_number }}
github-token: ${{ secrets.GITHUB_TOKEN }}
skip-mvnd-install: 'true'
extra-modules: ${{ inputs.extra_modules || '' }}
maven-extra-args: ${{ matrix.maven_extra_args || '' }}
- name: archive incremental test logs
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: always()
with:
name: incremental-test-java-${{ matrix.java }}.log
path: incremental-test.log
# All non-experimental JDK matrix entries upload with overwrite: true.
# This ensures a comment is posted even if one JDK build fails — the
# content is identical across JDKs (same modules tested), so last writer wins.
- name: Save PR number and test comment for commenter workflow
if: always() && !matrix.experimental
shell: bash
env:
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
mkdir -p ci-comment-artifact
prNumber="${{ github.event.number || inputs.pr_number }}"
echo "$prNumber" > ci-comment-artifact/pr-number
if [ -f incremental-test-comment.md ]; then
cp incremental-test-comment.md ci-comment-artifact/
# Append link to the workflow run for detailed results
echo "" >> ci-comment-artifact/incremental-test-comment.md
echo "---" >> ci-comment-artifact/incremental-test-comment.md
echo ":gear: [View full build and test results](${RUN_URL})" >> ci-comment-artifact/incremental-test-comment.md
fi
- name: Upload CI comment artifact
if: always() && !matrix.experimental
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: ci-comment
path: ci-comment-artifact/
overwrite: true