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 |
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)
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