Skip to content

chore(ci): add main branch build validation and concurrency control#20226

Closed
gnodet wants to merge 3 commits intoapache:mainfrom
gnodet:chore/add-main-build-workflow
Closed

chore(ci): add main branch build validation and concurrency control#20226
gnodet wants to merge 3 commits intoapache:mainfrom
gnodet:chore/add-main-build-workflow

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented Dec 4, 2025

Summary

  • Add main-build.yml workflow for push builds on main and release branches (camel-4.10.x, camel-4.14.x) with JDK 21
  • Add concurrency groups with cancel-in-progress: true to PR workflows (pr-build-main, depsreview, pr-doc-validation, pr-id) so outdated CI runs are automatically cancelled when a PR is updated

Changes from original PR

  • Rebased onto current main
  • Dropped JDK 17 from matrix (no longer supported per CAMEL-23112)
  • Updated all action versions to match current main (checkout v6, setup-java v5, upload-artifact v7)
  • Updated concurrency targets: pr-comment.yml was reorganized into pr-commenter.yml/pr-id.yml; concurrency added to pr-id.yml

Test plan

  • CI passes on this PR
  • Verify concurrency groups cancel previous runs on PR update
  • Verify main-build workflow triggers on push to main

🤖 Generated with Claude Code

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.
Copy link
Copy Markdown
Contributor

@squakez squakez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor points you may want to consider.

Comment thread .github/workflows/main-build.yml Outdated
push:
branches:
- main
- camel-4.4.x
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd keep only last 2 LTS instead. Altough this is not really affecting as we don't merge anything to older branches, it could be perceived as an argument for users which expects longer timeline maintenance for those older branches.

runs-on: ubuntu-latest
strategy:
matrix:
java: ['17', '21']
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the merge I'd reduce the quantity of resources by only checking against the latest JVM supported instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make more sense to keep the main build against all supported JVM and reduce the build in the PR to run only against the latest JVM rather than the opposite.

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.
@gnodet gnodet marked this pull request as ready for review January 23, 2026 14:18
@gnodet
Copy link
Copy Markdown
Contributor Author

gnodet commented Mar 5, 2026

Closing and recreating as a fresh PR with the rebased branch on current main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants