Overview of the GitHub Actions CI/CD ecosystem for Apache Camel.
PR opened/updated
│
├──► pr-id.yml ──► pr-commenter.yml (welcome message)
│
├──► pr-build-main.yml (Build and test)
│ │
│ ├── regen.sh (full build, no tests)
│ ├── incremental-build (test affected modules)
│ │ ├── File-path analysis
│ │ ├── POM dependency analysis
│ │ └── Extra modules (/component-test)
│ │
│ └──► pr-test-commenter.yml (post unified comment)
│
└──► sonar-build.yml ──► sonar-scan.yml (SonarCloud analysis)
[currently disabled — INFRA-27808]
PR comment: /component-test kafka http
│
└──► pr-manual-component-test.yml
│
└── dispatches "Build and test" with extra_modules
- Trigger:
pull_request(main branch),workflow_dispatch - Matrix: JDK 17, 21, 25 (25 is experimental)
- Steps:
- Full build via
regen.sh(mvn install -DskipTests -Pregen) - Check for uncommitted generated files
- Run incremental tests (only affected modules)
- Upload test comment as artifact
- Full build via
- Inputs (workflow_dispatch):
pr_number,pr_ref,extra_modules,skip_full_build
- Trigger:
workflow_runon "Build and test" completion - Purpose: Posts the unified test summary comment on the PR
- Why separate: Uses
workflow_runto run in base repo context, allowing comment posting on fork PRs (whereGITHUB_TOKENis read-only)
- Trigger:
issue_commentwith/component-testprefix - Who: MEMBER, OWNER, or CONTRIBUTOR only
- What: Resolves component names to module paths, dispatches the main "Build and test" workflow with
extra_modulesandskip_full_build=true - Build: Uses a quick targeted build (
-Dquickly) of the requested modules and their dependencies instead of the fullregen.shbuild
- Trigger:
pull_request(all branches) - Purpose: Posts the one-time welcome message on new PRs
- Why two workflows:
pr-id.ymlruns in PR context (uploads PR number),pr-commenter.ymlruns viaworkflow_runwith write permissions
- Trigger:
pushto main, camel-4.14.x, camel-4.18.x - Steps: Same as PR build but without comment posting
- Status: Temporarily disabled (INFRA-27808 — SonarCloud quality gate adjustment pending)
- Trigger:
pull_request(main branch) →workflow_runon SonarBuild completion - Why two workflows:
sonar-build.ymlruns in PR context (builds with JaCoCo coverage on core modules, uploads compiled classes artifact),sonar-scan.ymlruns viaworkflow_runwith secrets access to run the Sonar scanner and post results - Coverage scope: Currently limited to core modules (
camel-api,camel-core, etc.) andcoverageaggregator. Component coverage planned for future integration withincremental-build.shmodule detection
pr-labeler.yml— Auto-labels PRs based on changed filespr-doc-validation.yml— Validates documentation changespr-cleanup-branches.yml— Cleans up merged PR branchesalternative-os-build-main.yml— Tests on non-Linux OSescheck-container-versions.yml— Checks test container version updatesgenerate-sbom-main.yml— Generates SBOM for releasessecurity-scan.yml— Security vulnerability scanning
The core test runner. Determines which modules to test using:
- File-path analysis: Maps changed files to Maven modules
- POM dependency analysis (dual detection):
- Grep-based: For
parent/pom.xmlchanges, detects property changes and finds modules that explicitly reference the affected properties via${property}in theirpom.xmlfiles - Scalpel-based: Uses Maveniverse Scalpel (Maven extension) for effective POM model comparison — catches managed dependencies, plugin version changes, BOM imports, and transitive dependency impacts that the grep approach misses
- Grep-based: For
- Extra modules: Additional modules passed via
/component-test
Both detection methods run in parallel. Their results are merged (union), deduplicated, and tested. If Scalpel fails (build error, runtime error), the script falls back to grep-only with no regression.
The script also:
- Detects tests disabled in CI (
@DisabledIfSystemProperty(named = "ci.env.name")) - Applies an exclusion list for generated/meta modules
- Checks for excluded modules with associated integration tests (via
manual-it-mapping.txt) and advises contributors to run them manually - Generates a unified PR comment with all test information
Installs the Maven Daemon (mvnd) for faster builds.
Installs system packages required for the build.
| Label | Effect |
|---|---|
skip-tests |
Skip all tests |
test-dependents |
Force testing dependent modules even if threshold exceeded |
The CI sets -Dci.env.name=github.com via MVND_OPTS (in install-mvnd). Tests can use @DisabledIfSystemProperty(named = "ci.env.name") to skip flaky tests in CI. The test comment warns about these skipped tests.
The grep approach searches for ${property-name} references in module pom.xml files. It has known limitations:
- Managed dependencies without explicit
<version>— Modules inheriting versions via<dependencyManagement>without declaring<version>${property}</version>are missed. - Maven plugin version changes — Plugin version properties consumed in
parent/pom.xmlvia<pluginManagement>are invisible to child modules. - BOM imports — Modules using artifacts from a BOM are not linked to the BOM version property.
- Transitive dependency changes — Only direct property references are detected.
- Non-property version changes — Structural
<dependencyManagement>edits without property substitution are not caught.
Maveniverse Scalpel is a Maven core extension that compares effective POM models between the base branch and the PR. It resolves all 5 grep limitations by:
- Reading old POM files from the merge-base commit (via JGit)
- Comparing properties, managed dependencies, and managed plugins between old and new POMs
- Resolving the full transitive dependency graph to find all affected modules
- Detecting plugin version changes via
project.getBuildPlugins()comparison
Scalpel runs in report mode (-Dscalpel.mode=report), writing a JSON report to target/scalpel-report.json without modifying the Maven reactor. The report includes affected modules with reasons (SOURCE_CHANGE, POM_CHANGE, TRANSITIVE_DEPENDENCY, MANAGED_PLUGIN).
Both methods run in parallel. Results are merged (union) before testing. This lets us:
- Validate Scalpel — Compare what each method detects across many PRs
- No regression — If Scalpel fails, grep results are still used
- Gradual migration — Once Scalpel is validated, grep can be removed
Scalpel is configured permanently in .mvn/extensions.xml. On developer machines it is a no-op (disabled via -Dscalpel.enabled=false in .mvn/maven.config). The CI script overrides this with -Dscalpel.enabled=true. The mvn validate with report mode adds ~60-90 seconds in CI.
Scalpel is only invoked when a subdirectory pom.xml is changed (e.g. parent/pom.xml, components/camel-kafka/pom.xml). Changes to the root pom.xml are excluded because it contains build-infrastructure config (license plugin, checkstyle, etc.) that does not affect module compilation or test behavior. Without this filter, Scalpel would report every module as affected since they all inherit from the root POM.
- Source-set-aware propagation: Distinguishes test-jar dependencies from regular dependencies. A module that depends only on another module's test-jar (e.g.,
camel-core's test-jar with test utilities) is propagated through theTESTsource set, not theMAINsource set. This prevents a change to test utilities from triggering tests in all ~500 modules that depend oncamel-core. skipTestsForDownstreamModules: Allows specifying modules whose tests should be skipped when they appear as downstream dependents (mirrors theEXCLUSION_LISTinincremental-build.sh). This gives Scalpel an accurate picture of what skip-tests mode would actually test.
Scalpel runs in shadow mode: it observes what skip-tests mode would have done and reports it in a collapsible section of the PR comment, without affecting actual test execution. This allows the team to validate Scalpel's decisions across many PRs before switching to Scalpel-driven test execution.
The shadow comparison section shows:
- How many modules Scalpel would test (direct + downstream)
- How many downstream modules would have tests skipped (generated code, meta-modules)
- The full list of modules in each category
The script overrides fullBuildTriggers to empty (-Dscalpel.fullBuildTriggers=) because Scalpel's default (.mvn/**) would trigger a full build whenever .mvn/extensions.xml itself changes (e.g., Dependabot bumping Scalpel).
The grep-based script fetches the PR diff via the GitHub REST API (unchanged). Scalpel uses local git history to compare effective POM models — the CI workflow pre-fetches the base branch (git fetch --deepen=200 + fetch of origin/main) so Scalpel's JGit can find the merge-base. Scalpel disables its built-in JGit fetch (-Dscalpel.fetchBaseBranch=false) to avoid JGit issues in shallow CI clones. The --deepen=200 fetches only commit metadata (not file blobs), adding ~2-3 seconds to the job.
Some modules are excluded from CI's -amd expansion (the EXCLUSION_LIST) because they are generated code, meta-modules, or expensive integration test suites. When a contributor changes one of these modules, CI cannot automatically test all downstream effects.
The file manual-it-mapping.txt (co-located with the incremental build script) maps source modules to their associated integration test suites. When a changed module has a mapping entry, CI posts an advisory in the PR comment:
You modified
dsl/camel-jbang/camel-jbang-core. The related integration tests indsl/camel-jbang/camel-jbang-itare excluded from CI. Consider running them manually:mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
To add new mappings, edit manual-it-mapping.txt using the format:
source-artifact-id:it-module-path:command
All non-experimental JDK matrix entries (17, 21) upload the CI comment artifact with overwrite: true. This ensures a comment is posted even if one JDK build fails. Since the comment content is identical across JDKs (same modules are tested regardless of JDK version), last writer wins.
PR comments use HTML markers for upsert (create-or-update) behavior:
<!-- ci-tested-modules -->— Unified test summary comment