Skip to content

camel-telemetry: fix trace context propagation for messaging components #232

camel-telemetry: fix trace context propagation for messaging components

camel-telemetry: fix trace context propagation for messaging components #232

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: SonarBuild
on:
pull_request:
branches:
- main
paths-ignore:
- README.md
- SECURITY.md
- Jenkinsfile
- Jenkinsfile.*
- NOTICE.txt
permissions:
contents: read
concurrency:
group: sonar-pr-${{ github.event.pull_request.head.repo.full_name }}-${{ github.event.pull_request.head.ref }}
cancel-in-progress: true
jobs:
build:
# Temporarily disabled until SonarCloud quality gate is adjusted (INFRA-27808)
if: false && github.repository == 'apache/camel'
name: Build for Sonar Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: install-packages
uses: ./.github/actions/install-packages
- name: Set up JDK 21
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Build with Maven
run: ./mvnw install -B -Dquickly
# Run core tests with JaCoCo and generate aggregated coverage report.
# The source modules must be in the reactor so report-aggregate can
# map execution data from camel-core tests to their classes.
# TODO: Once incremental-build.sh supports module detection in the sonar
# workflow, replace the hardcoded -pl with detected affected modules
# to get coverage on components too (see PR #22247).
- name: Run tests with coverage and generate report
run: >
./mvnw verify -B -Dcoverage
-pl core/camel-api,core/camel-util,core/camel-support,core/camel-management-api,core/camel-management,core/camel-base,core/camel-base-engine,core/camel-core-engine,core/camel-core-languages,core/camel-core-model,core/camel-core-processor,core/camel-core-reifier,core/camel-core,coverage
-Dmaven.test.failure.ignore=true
- name: Prepare compiled classes artifact
shell: bash
run: find . -name "target" -type d | tar -czf target.tar.gz -T -
- name: Upload compiled classes artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
id: target-upload
with:
name: sonar-target
path: target.tar.gz
if-no-files-found: error
retention-days: 1
- name: Prepare pull request metadata
shell: bash
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
TARGET_ARTIFACT_ID: ${{ steps.target-upload.outputs.artifact-id }}
run: |
echo "$PR_NUMBER" > pr-event.txt
echo "$PR_HEAD_REF" >> pr-event.txt
echo "$PR_BASE_REF" >> pr-event.txt
echo "$PR_HEAD_SHA" >> pr-event.txt
echo "$TARGET_ARTIFACT_ID" >> pr-event.txt
- name: Upload pull request metadata
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: sonar-pr-event
path: pr-event.txt
if-no-files-found: error
retention-days: 1