Skip to main content

Overview

The typical CI setup:
  1. Get your API key from the Checksum web app and store it as a CI secret
  2. Choose a running strategy (on PR merge, on schedule, manual trigger)
  3. If tests are in a separate repo, create a Personal Access Token (PAT) with repo access
  4. 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

  1. Go to your GitHub repository → Settings → Secrets and variables → Actions
  2. Add the following secrets:
    • CHECKSUM_API_KEY — your Checksum API key
    • USERNAME — test user credentials
    • PASSWORD — test user password
    • BASE_URL — your application URL
    • LOGIN_URL — your login page URL
    • TEST_REPO_PAT (if cross-repo) — Personal Access Token with repo permissions

Testing the Action

  1. Commit the workflow file to your main branch
  2. Go to Actions → select your workflow → Run Workflow
  3. 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 — use checksum-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

That’s the whole step. The action auto-detects the source PR (from the event payload on pull_request, or via the GitHub API on push) and threads it through to auto-heal so progress comments land on the right PR.
@v2 is a breaking release. An empty test selection (e.g. a grep that matches nothing) now fails the step instead of passing. See the v2.0.0 release notes for the full list of behavior changes before upgrading from @v1.

Execution modes

Set exactly one of the following inputs to pick which tests to run:

Auto-heal on failure

Set auto-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. Set wait: 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:
wait: true keeps a runner allocated for the full test-run duration (typically 5–25 minutes). When runner-minute cost matters, prefer wait: false and use the standard PR-comment notification.

Sharding

Set shard-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:
Before your first sharded run, update checksumai on your tests branch to 4.4.0 or later (the minimum production-supported version for sharded runs) and commit it — npm install checksumai@latest is the safe default. Older versions can hit report-merge failures, delaying the run’s terminal verdict well past a normal run’s duration; combined with wait: true and no wait-timeout-seconds, the step then rides the workflow job’s own timeout-minutes. Always set wait-timeout-seconds (or a job-level timeout-minutes) alongside wait: true so the action bounds runner time if a stale runtime delays report merging.
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).
Sharding works best on a suite designed for parallel execution — isolated test data, no shared login/session state across tests. See Sharding Pitfalls before rolling out a large shard count.

Per-PR preview environments

Pass env-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

  1. Go to your GitLab project → Settings → CI/CD → Variables
  2. 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.
If you’re on GitHub Actions, the Checksum AI Test Run action wraps these endpoints in a single step — including the auto-heal trigger — and is usually a cleaner starting point than the raw API.

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.
Before your first sharded run, update checksumai on your tests branch to 4.4.0 or later (the minimum production-supported version for sharded runs) and commit it — npm install checksumai@latest is the safe default. Older versions can hit report-merge failures, delaying the run’s terminal verdict well past a normal run’s duration. See Sharded PR Run for the PR-scoped example.
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

For CI checks, poll until 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.
Update checksumai before enabling sharding. After all shards finish, Checksum combines their results using the checksumai version installed on the branch you run against. If that version is older than 4.4.0 (the minimum production-supported version for sharded runs), the merge can fail to complete, delaying the run’s terminal verdict well past a normal run’s duration. Update checksumai on your tests branch to 4.4.0 or later (npm install checksumai@latest is the safe default), commit it, and re-run.
envOverrides is for your own application variables only. Names reserved by Checksum, and any key starting with CHECKSUM_, are rejected with 400.
Use the v2 grep endpoint for PR-scoped sharded runs. The v1 execution endpoints can also shard, but they run against the project’s configured branch and environment.

Get Detailed Results

Trigger Auto-Healing

Poll Healing Progress

For the complete API documentation, see API Reference.

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:
When the run finishes with failures, healing starts automatically and (by default) opens a PR with the fixes. See the CLI Reference for the full --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.
When app-wide healing is enabled, tell Checksum which runs to treat as CI runs by setting this environment variable in your pipeline:
With that set, every failing run from this pipeline is healed automatically — no per-command flags needed.

Running Strategies

Start with manual triggers to verify your setup, then add scheduled or merge-triggered runs.