This directory contains GitHub Actions workflows for Apache Cloudberry CI/CD.
- Available Workflows
- Manual Workflow Triggers
- Artifact Reuse for Faster Testing
- Running Workflows in Forked Repositories
| Workflow | Purpose | Trigger |
|---|---|---|
build-cloudberry.yml |
Main CI: build, test, create RPMs | Push, PR, Manual |
build-dbg-cloudberry.yml |
Debug build with assertions enabled | Push, PR, Manual |
package-convenience-binaries.yml |
Build convenience DEB/RPM packages from an ASF-approved source release | Manual |
apache-rat-audit.yml |
License header compliance check | Push, PR |
coverity.yml |
Static code analysis with Coverity | Weekly, Manual |
sonarqube.yml |
Code quality analysis with SonarQube | Push to main |
docker-cbdb-build-containers.yml |
Build Docker images for CI | Manual |
docker-cbdb-test-containers.yml |
Build test Docker images | Manual |
Many workflows support manual triggering via workflow_dispatch, allowing developers to run CI jobs on-demand.
- Navigate to the Actions tab in GitHub
- Select the workflow from the left sidebar (e.g., "Build and Test Cloudberry")
- Click Run workflow button (top right)
- Select your branch
- Configure input parameters (if available)
- Click Run workflow
| Parameter | Description | Default | Example |
|---|---|---|---|
test_selection |
Comma-separated list of tests to run, or "all" | all |
ic-good-opt-off,ic-contrib |
reuse_artifacts_from_run_id |
Run ID to reuse build artifacts from (see below) | (empty) | 12345678901 |
Available test selections:
all- Run all test suitesic-good-opt-off- Installcheck with optimizer offic-good-opt-on- Installcheck with optimizer onic-contrib- Contrib extension testsic-resgroup- Resource group testsic-resgroup-v2- Resource group v2 testsic-resgroup-v2-memory-accounting- Resource group memory testsic-singlenode- Single-node mode testsmake-installcheck-world- Full test suite- And more... (see workflow for complete list)
This manual workflow supports two manual modes:
official_source_release: builds convenienceDEB/RPMpackages from an ASF-approved official source releasegit_ref_test: temporarily archives a specified tag or commit from the repository withgit archivesemantics and runs the same packaging flow for CI validation
| Parameter | Description | Example |
|---|---|---|
source_mode |
official_source_release or temporary git_ref_test |
official_source_release |
version |
Official release version | 2.2.0-incubating |
source_url |
Official Apache source tarball URL from downloads.apache.org |
https://downloads.apache.org/incubator/cloudberry/2.2.0-incubating/apache-cloudberry-2.2.0-incubating-src.tar.gz |
source_asc_url |
Detached GPG signature URL for the source tarball (.asc) |
https://downloads.apache.org/incubator/cloudberry/2.2.0-incubating/apache-cloudberry-2.2.0-incubating-src.tar.gz.asc |
source_sha512_url |
SHA-512 checksum URL for the source tarball (.sha512) |
https://downloads.apache.org/incubator/cloudberry/2.2.0-incubating/apache-cloudberry-2.2.0-incubating-src.tar.gz.sha512 |
git_ref |
Temporary test-only git tag or commit SHA | 2.1.0-incubating |
Workflow behavior:
- In
official_source_releasemode, verifies the source tarball with the projectKEYS,.asc, and.sha512before any build starts. - In
git_ref_testmode, checks out the specified tag or commit and prepares a temporary source tarball usinggit archivesemantics, including checked-out submodule contents, without Apache release verification. - Derives the package build version automatically by stripping a trailing
-incubatingfrom the release version before invoking the DEB/RPM packaging scripts. - Runs
unittest-cloudberry.shafter building from source and before packaging. - Installs each generated
DEB/RPM, verifies its.sha512, and runs agpdemosmoke test with basic SQL validation. - Runs the full flow, from source release verification to package generation, inside Cloudberry Docker build images instead of installing dependencies on the GitHub runner.
- Generates
.sha512files for each producedDEB/RPMartifact. - Preserves the default package filenames emitted by
dpkg-buildpackageandrpmbuild. - Does not generate detached
.ascsignatures for convenience binaries; that remains a release manager local signing step.
Input rules:
official_source_release: fillsource_url,source_asc_url, andsource_sha512_urlgit_ref_test: fillgit_ref; the Apache URL inputs may be left empty
Current target matrix:
rocky8:x86_64,arm64rocky9:x86_64,arm64ubuntu22.04:x86_64,arm64ubuntu24.04:x86_64,arm64
When debugging test failures, rebuilding Cloudberry (~50-70 minutes) on every iteration is inefficient. The artifact reuse feature allows you to reuse build artifacts from a previous successful run.
- Build artifacts (RPMs, source tarballs) from a previous workflow run are downloaded
- Build job is skipped (saves ~45-60 minutes)
- RPM installation test is skipped (saves ~5-10 minutes)
- Test jobs run with the reused artifacts
- You can iterate on test configurations without rebuilding
After a successful build (even if tests failed), get the run ID:
Option A: From GitHub Actions UI
- Go to Actions tab → Click on a completed workflow run
- The URL will be:
https://github.com/apache/cloudberry/actions/runs/12345678901 - The run ID is
12345678901
Option B: From GitHub API
# List recent workflow runs
gh run list --workflow=build-cloudberry.yml --limit 5
# Get run ID from specific branch
gh run list --workflow=build-cloudberry.yml --branch=my-feature --limit 1Via GitHub UI:
- Go to Actions → Build and Test Cloudberry
- Click Run workflow
- Enter the run ID in "Reuse build artifacts from a previous run ID"
- Optionally customize test_selection
- Click Run workflow
Via GitHub CLI:
# Reuse artifacts from run 12345678901, run only specific tests
gh workflow run build-cloudberry.yml \
--field reuse_artifacts_from_run_id=12345678901 \
--field test_selection=ic-good-opt-off- Build job will be skipped (shows as "Skipped" in Actions UI)
- RPM Install Test will be skipped
- Test jobs will run with artifacts from the specified run ID
- Total time: ~15-30 minutes (vs ~65-100 minutes for full build+test)
Debugging a specific test failure:
# Run 1: Full build + all tests (finds test failure in ic-good-opt-off)
gh workflow run build-cloudberry.yml
# Get the run ID from output
RUN_ID=$(gh run list --workflow=build-cloudberry.yml --limit 1 --json databaseId --jq '.[0].databaseId')
# Run 2: Reuse artifacts, run only failing test
gh workflow run build-cloudberry.yml \
--field reuse_artifacts_from_run_id=$RUN_ID \
--field test_selection=ic-good-opt-offTesting different configurations:
# Test with optimizer off, then on, using same build
gh workflow run build-cloudberry.yml \
--field reuse_artifacts_from_run_id=$RUN_ID \
--field test_selection=ic-good-opt-off
gh workflow run build-cloudberry.yml \
--field reuse_artifacts_from_run_id=$RUN_ID \
--field test_selection=ic-good-opt-on- Artifacts expire after 90 days (GitHub default retention)
- Run ID must be from the same repository (or accessible fork)
- Artifacts must include both RPM and source build artifacts
- Cannot reuse artifacts across different OS/architecture combinations
- Changes to source code require a fresh build
GitHub Actions workflows are enabled in forks, allowing you to validate changes before submitting a Pull Request.
-
Fork the repository to your GitHub account
-
Enable GitHub Actions in your fork:
- Go to your fork's Actions tab
- Click "I understand my workflows, go ahead and enable them"
Secrets Configuration:
No manual secret configuration is required for the main build and test workflows.
GITHUB_TOKENis automatically provided by GitHub and used when downloading artifacts from previous runs (artifact reuse feature)- DockerHub secrets (
DOCKERHUB_USER,DOCKERHUB_TOKEN) are only required for building custom container images (advanced/maintainer use case, not needed for typical development)
- ✅ Automated triggers work: Push and PR events trigger workflows
- ✅ Manual triggers work:
workflow_dispatchis fully functional - ✅ Artifact reuse works: Can reuse artifacts from previous runs in your fork
⚠️ Cross-fork artifact reuse: Not supported (security restriction)⚠️ Some features may be limited: Certain features requiring organization-level secrets may not work
- Test locally first when possible (faster iteration)
- Use manual triggers to avoid burning GitHub Actions minutes unnecessarily
- Use artifact reuse to iterate on test failures efficiently
- Push to feature branches to trigger automated CI
- Review Actions tab to ensure workflows completed successfully before opening PR
# 1. Create feature branch in fork
git checkout -b fix-test-failure
# 2. Make changes and push to fork
git commit -am "Fix test failure"
git push origin fix-test-failure
# 3. CI runs automatically on push
# 4. If tests fail, iterate using artifact reuse
# Get run ID from your fork's Actions tab
gh workflow run build-cloudberry.yml \
--field reuse_artifacts_from_run_id=12345678901 \
--field test_selection=ic-good-opt-off
# 5. Once tests pass, open PR to upstream
gh pr create --webCause: Artifacts from specified run ID not found or expired
Solution:
- Verify the run ID is correct
- Check that run completed successfully (built artifacts)
- Run a fresh build if artifacts expired (>90 days)
Cause: GitHub Actions not enabled in fork
Solution:
- Go to fork's Actions tab
- Click to enable workflows
Cause: Workflow trying to access artifacts from different repository
Solution:
- Can only reuse artifacts from same repository
- Run a fresh build in your fork first, then reuse those artifacts
