Overview
You can drive Roark from CI so your agent is tested on every change, not just by hand. It combines two things you already have:- Config as Code keeps your test suite (customer flows, personas, metrics, collectors) in your git repo, so CI can sync it with one command.
- The CLI triggers a simulation run for a saved run plan.
Both steps authenticate with a project API key that carries the right permissions (
config:apply for the sync step). Store it as a CI secret and export it as ROARK_API_BEARER_TOKEN; every CLI command picks it up with no interactive login. See Using the CLI in CI.Step 1: Sync your test suite
Keep your flows, personas, metrics, and collectors as YAML in your repo and apply them so the project matches what’s in git:apply exits non-zero if the bundle is invalid, so a broken config fails the build on its own. Run roark config diff ./roark on pull requests to preview changes before they land. See Config as Code for the full workflow.
Config as Code manages resource definitions. It does not start a run by itself, that’s the next step.
Step 2: Trigger a run
Start a run for a saved plan by its ID:simulationRunPlanJobId. The run then executes asynchronously against your agents.
Step 3: See the results
Open the run in Roark to see its verdict: the pass rate across every check, per-conversation scores, and any failures, on the run report. If you want CI to wait for the run to finish, poll its lifecycle status until it reaches a terminal state (COMPLETED, FAILED, TIMED_OUT, or CANCELLED):
Today the CLI reports whether the run was triggered and completed, not whether its checks passed: review the pass/fail verdict in the run report. A native pass/fail exit code for gating a build directly on the result is in progress.
GitHub Actions example
Sync config and kick off a run on every merge tomain:
npx @roarkanalytics/cli config diff ./roark in a pull_request-triggered job (the same pattern shown in Using the CLI in CI).
Related
Config as Code
Define your test suite as YAML in git
Run plans
Build the reusable plan CI runs
CLI
Install, authenticate, and use the CLI in CI
Running simulations
Launch runs and read the report