# Travis CI

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

Run your Shiplight E2E tests in Travis CI and upload the results to [Shiplight Cloud](https://app.shiplight.ai). Travis 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 repository **environment variable** named `SHIPLIGHT_API_TOKEN` (**Settings → Environment Variables**; keep "Display value in build log" off).

## Pipeline

Create `.travis.yml` at your repository root:

```yaml
language: node_js
node_js:
  - "20"

addons:
  apt:
    packages:
      - libnss3
      - libatk-bridge2.0-0
      - libgtk-3-0

env:
  global:
    - SHIPLIGHT_REPORT_TO_CLOUD=1
    # Set SHIPLIGHT_API_TOKEN in the Travis repo settings, not here.

install:
  - npm install
  - npx playwright install --with-deps chromium

script:
  - npx shiplight test

after_script:
  - npx shiplight report # after_script runs regardless of the build result
```

## Notes

- `SHIPLIGHT_API_TOKEN` and `SHIPLIGHT_REPORT_TO_CLOUD=1` are required on every non-Shiplight runner — they are provided automatically only on [Shiplight-hosted GitHub runners](/local/ci/github-actions).
- Install Chromium yourself. `--with-deps` pulls most system libraries; the `apt` addon above covers the rest on Travis's Ubuntu images.
- `after_script` runs whether or not `script` passed, so the upload survives a red run. (Note that a failure inside `after_script` does not fail the build.)
- **Not available on Travis CI:** Shiplight-hosted runners, the self-healing action cache, automatic LLM credentials, and [auto-triage](/local/ci/github-actions#auto-triage-ci-failures-optional) — those are GitHub Actions only.
- Project in a subdirectory (e.g. `tests/e2e`)? `cd tests/e2e` at the start of each phase, or set `before_install: cd tests/e2e`.

## Related

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