---
title: CI/CD
description: Run Shiplight E2E tests in CI on every push or pull request. Let your agent wire the workflow, upload results to Shiplight Cloud, and optionally auto-triage failures.
---

# CI/CD

<div class="view-markdown-wrapper">
<ViewMarkdown />
</div>

Run your Shiplight E2E tests in CI on every push or pull request, and upload the results to [Shiplight Cloud](https://app.shiplight.ai) for trend tracking, flaky-test detection, and team visibility.

Not sure whether CI should run on your own provider's machines or on Shiplight-hosted runners? Start with [Where tests run](/local/where-tests-run).

## How it fits together

Three separate pieces, and it pays to keep them distinct:

- **Your Shiplight test project**: `tests/`, `specs/`, and a `package.json` that includes the `shiplightai` CLI. Scaffolded by `/shiplight init`; it must exist first.
- **A CI config file**: tells your CI provider how to install dependencies, run `shiplight test`, and upload with `shiplight report`. 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:

```bash
npm install                       # installs the shiplight CLI (shiplightai) + project deps
npx playwright install chromium   # the browser the tests drive
npx shiplight test                # run the tests
npx shiplight report              # upload results (run even when tests fail)
```

## Let your agent set it up

Once tests exist, your agent can wire them into CI for you:

```
/shiplight ci
```

The 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](/cloud_v2/)** 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](https://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](#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 supply `SHIPLIGHT_API_TOKEN` or your own LLM credentials; a Shiplight token is still required for report uploads and the shared Cloud action cache.
- **[Shiplight CI runners](/cloud_v2/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-on` line.

[Where tests run](/local/where-tests-run) compares the two (and local runs) with the cost implications of each.

## GitHub is first-class

[**GitHub Actions**](/local/ci/github-actions) is the primary integration. Only there do you get Shiplight-hosted ephemeral runners (Chromium pre-installed and credentials auto-provisioned) and the failure [auto-triage](#auto-triage-failures) pipeline. 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](/local/ci/action-cache) 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

`/shiplight ci` can also wire a second workflow that watches the first. When a test run goes red, an AI agent reads the run logs and the uploaded failure evidence (screenshots and traces) and:

1. **Posts a diagnosis to Slack**, so the team knows what broke without opening CI
2. **For fixable test issues, applies the repair itself**: the CI equivalent of [running `fix` locally](/guides/fix-a-failing-test). It re-runs the test to confirm, then **opens a PR** with the fix

It never auto-merges, and the autofix agent can only touch the paths you allow (your test directories). Ask for it once the test workflow exists:

```
/shiplight ci, add the failure triage pipeline to the E2E workflow
```

Triage builds on GitHub's `workflow_run` trigger, so it's GitHub Actions only. Full wiring and configuration: [Auto-triage CI failures](/local/ci/github-actions#auto-triage-ci-failures-optional).

## Reading results

Each run lands in [Shiplight Cloud](/cloud_v2/) 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 run
```

## Other providers

The `shiplight` CLI runs on any pipeline that has Node.js 22 or newer. Each page below gives a copy-paste template. Shiplight-hosted runners, automatically provisioned credentials, and auto-triage are **GitHub Actions only**; everywhere else 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](/local/ci/gitlab)
- [Depot CI](/local/ci/depot-ci)
- [CircleCI](/local/ci/circleci)
- [Jenkins](/local/ci/jenkins)
- [Travis CI](/local/ci/travis)
- [Buildkite](/local/ci/buildkite)
- [Azure DevOps](/local/ci/azure-devops)
- [Custom setups](/local/ci/custom): 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, the required browser dependencies, and a Playwright browser version compatible with the project.

## Related

- [Where tests run](/local/where-tests-run): local vs Shiplight runners vs your own CI, and what each costs
- [CLI Reference](/local/cli-reference): full `shiplight test` / `shiplight report` documentation
- [Run Locally](/local/run-locally): project structure, authentication, and configuration
