CI/CD Integration

June 3, 2026 ยท View on GitHub

Problem: How do you prevent broken AI agents from reaching production? Manual testing doesn't scale, and LLM outputs are non-deterministic.

Solution: EvalView integrates with CI/CD pipelines to automatically run agent regression tests on every PR and block merges when behavior degrades. It provides a GitHub Action, PR comments with alerts, job summaries, proper exit codes, and retry-resilient posting.

EvalView is CLI-first. You can run it locally or add to CI.


Quick Start (GitHub Actions)

Copy this to .github/workflows/evalview.yml:

name: EvalView Regression Check

on:
  pull_request:
  push:
    branches: [main]

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Check for regressions
        id: evalview
        uses: hidai25/eval-view@v0.8.0
        with:
          openai-api-key: ${{ secrets.OPENAI_API_KEY }}
          fail-on: REGRESSION

      - name: Upload report
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: evalview-report
          path: evalview-report.html
          if-no-files-found: ignore

      - name: Post PR comment
        if: github.event_name == 'pull_request' && always()
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          pip install evalview -q
          evalview ci comment --results ${{ steps.evalview.outputs.results-file }}

Setup:

  1. Add OPENAI_API_KEY to your repository secrets
  2. Run evalview snapshot locally to create your baseline
  3. Commit .evalview/golden/ to git

That's it. Every PR now gets a regression check, a PR comment, and a job summary.


PR Comments

evalview ci comment generates a markdown comment and posts it to your PR. It auto-detects the PR context from GitHub Actions environment variables.

What you see on a clean PR

## โœ… EvalView: PASSED

| Metric | Value |
|--------|-------|
| Tests | 5/5 unchanged (100%) |

What you see when something breaks

## โŒ EvalView: REGRESSION

> **Alerts**
> - ๐Ÿ’ธ Cost spike: \$0.02 โ†’ \$0.08 (+300%)
> - โฑ๏ธ Latency spike: 1.5s โ†’ 4.2s (+180%)
> - ๐Ÿค– Model/runtime update: declared, high confidence

| Metric | Value |
|--------|-------|
| Tests | 3/5 unchanged (60%) |
| Regressions | 1 |
| Tools Changed | 1 |
| Model Runtime Signal | declared (high confidence) |

### Changes from Baseline
- โŒ **search-flow**: score -15.0, 1 tool change(s)
- โš ๏ธ **create-flow**: 1 tool change(s)

<details>
<summary>... and 3 more change(s)</summary>

- โš ๏ธ **update-flow**
- โš ๏ธ **delete-flow**
- โš ๏ธ **list-flow**

</details>

[View full report](https://github.com/yourorg/yourrepo/actions/runs/12345)

---
*Generated by EvalView*

Features

FeatureDescription
Cost spike alertsWarns when total cost increases >50% from baseline
Latency spike alertsWarns when total latency increases >50% from baseline
Model/runtime calloutShows declared or suspected upstream updates with evidence
Collapsible overflowFirst 5 changes shown inline, rest collapsed in <details>
Comment deduplicationUpdates existing EvalView comment instead of creating duplicates
Retry with backoffRetries gh CLI calls up to 3x with exponential backoff
Job summaryWrites results to $GITHUB_STEP_SUMMARY for Actions UI visibility

CLI Options

evalview ci comment                              # Auto-detect results + post
evalview ci comment --results path/to/file.json  # Specific results file
evalview ci comment --dry-run                    # Preview without posting
evalview ci comment --no-update                  # Always create new comment

Three Comment Formats

evalview ci comment auto-detects the results format:

SourceCommandComment
evalview check --jsonRegression detectionDiffs, alerts, model changes
evalview runFull evaluationScores, pass/fail, cost
evalview generateTest generationDiscovered tools, coverage gaps

Job Summary

Every CI run writes results to $GITHUB_STEP_SUMMARY, making them visible directly in the GitHub Actions UI โ€” no need to click into the PR comment or download artifacts.

The job summary contains the same markdown as the PR comment: status, metrics, alerts, and diffs.

The job summary is written by the evalview ci comment step in your workflow. The recommended Quick Start workflow above includes this step. If you omit it, no job summary will appear.


Review Generated Suites in PRs

If you use evalview generate, every run writes a machine-readable suite report:

tests/generated/generated.report.json

Turn that into a PR comment:

evalview ci comment --results tests/generated/generated.report.json

The generated-suite comment includes:

  • discovered tools
  • draft behavior paths
  • coverage gaps
  • approval instructions for snapshot --approve-generated

Recommended flow:

evalview generate --agent http://localhost:8000
evalview ci comment --results tests/generated/generated.report.json
evalview snapshot tests/generated --approve-generated

GitHub Action Reference

Inputs

InputDescriptionDefault
modecheck (regression detection) or run (full evaluation)check
openai-api-keyOpenAI API key for LLM-as-judge-
anthropic-api-keyAnthropic API key (optional)-
test-pathPath to test cases directorytests
config-pathPath to config file.evalview/config.yaml
fail-onStatuses that fail CI (comma-separated)REGRESSION
strictFail on any changefalse
diffCompare against golden baselines (run mode)false
contractsCheck MCP contracts for driftfalse
filterFilter tests by name pattern-
max-workersParallel workers4
max-retriesRetry failed tests2
fail-on-errorFail workflow on test failuretrue
generate-reportGenerate HTML reporttrue
python-versionPython version3.11

Outputs

OutputDescription
results-filePath to JSON results
report-filePath to HTML report
total-testsTotal tests run
passed-testsPassed/unchanged count
failed-testsFailed/regressed count
regressionsRegressions detected (check mode)
tools-changedTests with tool changes (check mode)
pass-ratePass rate percentage
statusOverall: passed, regression, tools_changed, output_changed

Configurable Strictness

Control what fails your CI:

# Default: only fail on score drops
evalview check --fail-on REGRESSION

# Stricter: also fail on tool changes
evalview check --fail-on REGRESSION,TOOLS_CHANGED

# Strictest: fail on any change
evalview check --strict

Exit Codes

ScenarioExit Code
All tests pass, all PASSED0
All tests pass, only warn-on statuses0 (with warnings)
Any test fails OR any fail-on status1
Execution errors (network, timeout)2

Pre-Push Hooks (Zero CI Config)

evalview install-hooks

Regression checks run before every git push. No CI pipeline needed โ€” works purely locally.


GitLab CI

evalview:
  image: python:3.11
  script:
    - pip install evalview
    - evalview check --json --fail-on REGRESSION > results.json
  variables:
    OPENAI_API_KEY: $OPENAI_API_KEY
  artifacts:
    paths:
      - results.json

CircleCI

version: 2.1
jobs:
  evalview:
    docker:
      - image: python:3.11
    steps:
      - checkout
      - run: pip install evalview
      - run: evalview check --json --fail-on REGRESSION