# GitLab CI

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

Run your Shiplight E2E tests in GitLab CI and upload the results to [Shiplight Cloud](https://app.shiplight.ai). GitLab uses the same `shiplight` CLI as every other provider — only the pipeline syntax differs.

## Before you start

- A scaffolded Shiplight test project (`/shiplight init`). See the [CI/CD overview](/local/ci) for how the pieces fit together.
- An org API token from [app.shiplight.ai/api-tokens](https://app.shiplight.ai/api-tokens), stored as a **masked** CI/CD variable named `SHIPLIGHT_API_TOKEN` (**Settings → CI/CD → Variables**). GitLab injects it into the job automatically.

## Pipeline

Create `.gitlab-ci.yml` at your repository root:

```yaml
e2e:
  image: node:22
  variables:
    # SHIPLIGHT_API_TOKEN comes from a masked CI/CD variable — no need to repeat it here.
  before_script:
    - curl -fsSL https://bun.sh/install | bash
    - export PATH="$HOME/.bun/bin:$PATH"
  script:
    - bun install
    - bun run playwright install --with-deps chromium
    - bun run shiplight test
```

## Notes

- `SHIPLIGHT_API_TOKEN` enables completed test report uploads; set it as a CI secret.
- With `SHIPLIGHT_API_TOKEN` set, AI-powered actions (natural-language steps, self-healing locators) run through the Shiplight LLM proxy, and healed locators persist to the Shiplight Cloud action cache so later runs replay at full speed.
- Install Chromium yourself (`bun run playwright install --with-deps chromium`); no stock image ships it.
- **Failure triage on GitLab:** classification runs on the server for uploaded runs from any provider, but the optional autofix workflow ([auto-triage](/local/ci#auto-triage-failures)) is GitHub Actions only.
- Project in a subdirectory (e.g. `tests/e2e`)? Add `cd tests/e2e` after the Bun setup commands in this job's `before_script`.

## Related

- [CI/CD overview](/local/ci) · [Custom setups](/local/ci/custom) · [CLI Reference](/local/cli-reference)
