CI/CD
Run your Shiplight E2E tests in CI on every push or pull request, and upload the results to Shiplight Cloud for trend tracking, flaky-test detection, and team visibility.
Not sure where your tests should run? Start with Where tests run.
How it fits together
Three separate pieces, and it pays to keep them distinct:
- Your Shiplight test project:
tests/,specs/, and apackage.jsonthat includes theshiplightaiCLI. Scaffolded by/shiplight init; it must exist first. - A CI config file: tells your CI provider how to install dependencies and run
shiplight test, which uploads its completed report whenSHIPLIGHT_API_TOKENis set. One file per provider, at your repository root. - Your CI provider: GitHub Actions, GitLab, etc. It detects the config file and runs it automatically on the trigger you set (push / PR / MR).
The config file does not create tests; it runs an existing project. On every provider the job boils down to the same four commands:
bun install # installs the shiplight CLI (shiplightai) + project deps
bun run playwright install chromium # the browser the tests drive
bun run shiplight test # run tests and upload the completed reportThe token enables report upload automatically. shiplight report also uploads when regenerating or merging a report; set SHIPLIGHT_REPORT_TO_CLOUD=0 to disable uploads.
Let your agent set it up
Once tests exist, your agent can wire them into CI for you:
/shiplight ciThe agent looks at your repo, picks the right runner setup, writes the workflow, and tells you which secrets to add. You get a working workflow file in your repo (for GitHub Actions, .github/workflows/e2e.yml) that:
- Runs the suite on every push to main and every pull request
- Uploads results to Shiplight Cloud even when tests fail, so a red run still produces a report with screenshots, videos, and traces
The one manual step: create an API token at app.shiplight.ai/api-tokens and store it as the SHIPLIGHT_API_TOKEN secret.
For providers other than GitHub Actions, copy the template from the matching page under Other providers.
Where the job runs
The commands above are the same wherever the job executes. What differs is the machine:
- Your CI provider's runners: GitHub's
ubuntu-latest, GitLab shared runners, and so on. You install the browser and supplySHIPLIGHT_API_TOKENor your own LLM credentials; a Shiplight token is still required for report uploads and the shared Cloud action cache. - Shiplight CI runners: ephemeral Shiplight-hosted VMs with Chromium, Firefox, and WebKit preinstalled and credentials injected per run. GitHub Actions only, and enabled by changing a single
runs-online.
Where tests run compares the two (and local runs) with the cost implications of each.
GitHub is first-class
GitHub Actions is the primary integration. Only there can you add the optional autofix workflow. Runtime self-healing is part of the shiplight CLI on every provider, and the shared Shiplight Cloud action cache works in any CI environment configured with CI=true and SHIPLIGHT_API_TOKEN. If you're on GitHub, start there.
Persist action cache without Shiplight Cloud
Set SHIPLIGHT_ACTION_CACHE_BACKEND=local to keep self-healed actions in .shiplight/action-cache/, even in CI with a Shiplight token. Choose either CI cache storage (restore and save the directory) or Git commits (track cache JSON and let CI commit changes). Both avoid the Shiplight action-cache API; AI credentials and report uploads are configured separately.
See Action cache in CI for workflow examples for both approaches and their conflict handling, and how to verify actual cache hits. The default auto backend still selects cloud storage in CI when a token is available; cloud explicitly selects it outside CI too.
Auto-triage failures
Failed tests in uploaded runs can be triaged in two parts:
Classification runs on the Shiplight server for uploaded runs from any CI provider. It is off by default and needs no workflow step. An organization owner turns it on with a personal API token that has
organizations:write(or full access):bashcurl -X PUT "$SHIPLIGHT_API_URL/v1/org/triage-settings" \ -H "Authorization: Bearer $SHIPLIGHT_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"classify": true, "autofix": false}'Set
"autofix": truetoo when you add the autofix workflow.SHIPLIGHT_API_URLishttps://api.shiplight.aion the public service. Classification calls a model, so like other AI calls it needs credit and, except on an Enterprise contract, a card on file or a paid top-up (Billing); without them, failed runs upload but aren't classified.Autofix (optional) is a GitHub Actions workflow (not yet available for Bun projects). For fixable test issues, an agent applies the repair (the CI equivalent of running
fixlocally), re-runs the test to confirm, then opens a PR with the fix. It never auto-merges, and it can only touch the paths you allow (your test directories).
Notifications, such as a Slack message, are separate: wire them in a job you own. Ask your agent to set up autofix once the test workflow exists:
/shiplight ci, add the optional autofix workflow for failed E2E testsThe manual setup in the GitHub Actions guide describes the earlier ci-triage workflow, which existing callers can keep using.
Reading results
Each run lands in Shiplight Cloud with its artifacts. Across runs you get trends, flaky-test detection, and failure attribution. Ask for them right from your agent:
/shiplight cloud, show failing tests from the last runOther providers
The shiplight CLI runs on any pipeline with Node.js 22 or newer. The templates use Bun for package management and command invocation, so install both runtimes where needed. Each page below gives a copy-paste template. The optional autofix workflow is GitHub Actions only. On every provider you supply the API token and install Chromium yourself.
AI-powered steps, including runtime self-healing, work on every provider when the job has SHIPLIGHT_API_TOKEN or supported bring-your-own-model credentials. With CI=true and a Shiplight token that has action-cache:read and action-cache:write, healed locators from passing tests are stored in the shared Shiplight Cloud action cache and can be reused by later runs.
- GitLab CI
- Depot CI
- CircleCI
- Jenkins
- Travis CI
- Buildkite
- Azure DevOps
- Custom setups: the generic recipe for any other provider
Slow downloads in CI
On hosted runners with restricted or high-latency network access, installing dependencies or Playwright browsers may take significantly longer than expected.
Use a trusted regional mirror, proxy, or prebuilt container image provided by your organization or CI provider. A prebuilt image should include Node.js 22 or newer, Bun, the required browser dependencies, and a Playwright browser version compatible with the project.
Related
- Where tests run: local runs vs CI
- CLI Reference: full
shiplight test/shiplight reportdocumentation - Run Locally: project structure, authentication, and configuration