CI/CD
Delivery Hub follows Salesforce's recommended development model: source-driven development with scratch orgs, automated testing, and continuous integration via CumulusCI and GitHub Actions.
Development Workflow
Every pull request gets its own scratch org. Tests run automatically. If they pass, the PR is ready for code review.
Developer creates a feature branch from main.
GitHub Actions spins up a fresh scratch org and deploys the branch.
All 74+ Apex test classes run automatically. Code coverage is reported.
PR is reviewed by the team. The scratch org is available for manual QA.
After approval, the branch merges to main. The scratch org is deleted.
Main branch is deployed to the packaging org and a new version is created.
CumulusCI Setup
Delivery Hub uses CumulusCI (CCI) for build automation. CCI provides tasks for creating scratch orgs, deploying metadata, loading data, and running tests.
Key CCI Tasks
| Task | Description |
|---|---|
| cci flow run dev_org | Creates a scratch org, deploys source, loads sample data. |
| cci flow run ci_feature | CI flow: create scratch org, deploy, run all tests, report coverage. |
| cci flow run ci_master | Main branch flow: deploy to packaging org, create beta version. |
| cci task run run_tests | Run all Apex tests in the connected org. |
| cci task run dx_push | Push source to the default scratch org. |
GitHub Actions
The repository includes GitHub Actions workflows that automate the entire CI pipeline. Workflows are stored in .github/workflows/.
Workflow: Feature Branch
Workflow: Main Branch
Scratch Org Per PR
Each pull request automatically gets a dedicated scratch org. This ensures:
- Tests run in a clean environment every time
- Reviewers can log into the scratch org for manual QA
- No conflicts between concurrent feature branches
- Scratch orgs are automatically deleted when the PR is merged or closed
Apex Tests
Delivery Hub includes 74+ Apex test classes covering:
- •Unit tests — individual methods and utility classes
- •Trigger tests — all object triggers with bulk data scenarios
- •Integration tests — sync engine, REST endpoints, callout mocks
- •LWC tests — Jest tests for all Lightning Web Components
Code coverage consistently exceeds 90% across the entire codebase. Tests are run automatically on every PR via GitHub Actions.
Related
- Architecture — data model and system design
- GitHub Repository — browse source code and workflows