Overview
The typical CI setup:- Get your API key from the Checksum web app and store it as a CI secret
- Choose a running strategy (on PR merge, on schedule, manual trigger)
- If tests are in a separate repo, create a Personal Access Token (PAT) with repo access
- Add the CI configuration below
GitHub Actions
Basic Setup
Create.github/workflows/checksum-tests.yml:
Cross-Repo Setup
If your tests live in a different repository than the one running the action, checkout the test repo using a Personal Access Token:Setting Up Secrets
- Go to your GitHub repository → Settings → Secrets and variables → Actions
- Add the following secrets:
CHECKSUM_API_KEY— your Checksum API keyUSERNAME— test user credentialsPASSWORD— test user passwordBASE_URL— your application URLLOGIN_URL— your login page URLTEST_REPO_PAT(if cross-repo) — Personal Access Token with repo permissions
Testing the Action
- Commit the workflow file to your main branch
- Go to Actions → select your workflow → Run Workflow
- Monitor the run to confirm tests execute successfully
GitHub Action (no CLI install)
If you don’t need to run tests on your own runner — e.g., your CI just needs to trigger a Checksum run and let Checksum execute it — usechecksum-ai/test-run-action. It wraps the public-API execution endpoints in a single step, with optional auto-heal-on-failure built in.
Quick start
pull_request, or via the GitHub API on push) and threads it through to auto-heal so progress comments land on the right PR.
Execution modes
Set exactly one of the following inputs to pick which tests to run:Auto-heal on failure
Setauto-heal: true to run Auto-Healing when the test run fails. Healing sessions start automatically and (by default) push fixes as a PR. Healing progress is reported as a comment on the originating PR — no extra wiring needed when running on pull_request events.
To dispatch heal sessions without auto-creating a PR:
Wait for completion (gate the workflow)
By default the action exits as soon as the dispatch is accepted (~15s) — you get notified about results via the standard PR comment. Setwait: true if you want the workflow check itself to gate on the test outcome. The exit code gates on the run’s verdict (pass/fail), which correctly reflects sharded runs, empty selections, and infra failures:
Sharding
Setshard-count (2–40, honored in grep and affected modes) to fan the run out across parallel shards and merge the results into one verdict — the same sharding used in the Sharded PR Run curl example, wrapped in a single step:
shard-count composes with auto-heal from action v2.1.0 onward: once the shards are merged, a merged run that ends failed is healed exactly as a non-sharded run would be. If the shards never merge (stale checksumai, see above), the heal is never evaluated. Older action versions reject the combination client-side, so update your pin (@v2 already resolves to the latest 2.x).Per-PR preview environments
Passenv-overrides (grep mode only) to inject per-run environment variables — handy when each PR is deployed to its own preview URL:
Full reference
The complete inputs/outputs reference and changelog live in the action’s README. Use@v2 for compatible updates, @v2.0.0 for a release-specific tag, or a full commit SHA for immutability — tags (including @v2.0.0) can technically be moved by the repo owner, so a SHA pin is the only guarantee (see GitHub’s guidance on pinning third-party actions). @v1 remains available for the pre-sharding behavior but is no longer updated — see the v2.0.0 release notes for what changed.
GitLab CI/CD
Basic Setup
Add to your.gitlab-ci.yml:
Cross-Repo Setup
If tests are in a separate repository:Setting Up CI/CD Variables
- Go to your GitLab project → Settings → CI/CD → Variables
- Add the same variables as listed in the GitHub section above
Programmatic CI Integration (API)
Instead of running the CLI directly, you can trigger and manage test runs programmatically using the Checksum API. This is useful for custom CI pipelines, orchestration tools, or when you need to chain test runs with other operations.Run Tests
shardCount is optional. Omit it, or set it to 1, for a non-sharded run. Set it to 2 through 40 to split the selected tests across parallel shards. Each shard runs one Playwright worker, so parallelism is controlled by shardCount alone.
Sharding composes with
autoHeal: once the shards are merged, a merged run that ends failed is healed exactly as a non-sharded run would be. If the shards never merge (stale checksumai, see above), the heal is never evaluated.Poll for Results by Run ID
isTerminal is true, then pass the workflow only when verdict is "pass".
API-triggered runs can’t currently be cancelled through the public API. Cancelling the workflow (for example via
concurrency: cancel-in-progress) stops your status polling, but the Checksum run continues until it finishes.Sharded PR Run with curl
For pull-request checks that need a PR branch and preview URL, use the v2 grep endpoint. It accepts branch, envOverrides, and shardCount in one request.
envOverrides is for your own application variables only. Names reserved by Checksum, and any key starting with CHECKSUM_, are rejected with 400.Get Detailed Results
Trigger Auto-Healing
Poll Healing Progress
Auto-healing failed CI runs
Checksum can fix failing tests after a CI run and open a PR with the fixes. Enable auto-heal per run or for your whole app:Per-run, from the test command
Add the auto-heal flag to your test command. This works the same on GitHub Actions and GitLab CI — the repository, branch, and pull-request number are detected automatically from the CI environment:--cksm-auto-heal* flag set, and Auto-Healing for how healing works.
App-wide
Checksum can enable automatic healing for your whole app, so every failing CI run is healed without adding flags to each pipeline. Contact your Checksum representative to turn this on for your app.