Connecting CI
evalship reads eval results from GitHub Actions, GitLab CI or your own machine. It doesn't run your eval tests.
| Where the evals run | How the results reach evalship |
|---|---|
| GitHub Actions | evalship reads the result files in a workflow run's artifacts. There is no evalship action to add, and no token or secret to configure. Start at Requirements. |
| GitLab CI | evalship reads the result files in the eval job's artifacts when the job ends. See GitLab. |
| Your machine | Your coding agent sends the results file with an upload token, so model keys stay off GitHub. See [Run evals on your machine]. |
| Your machine, without GitHub | The same, for a repository on GitLab, elsewhere or with no remote. See Without GitHub. A gitlab.com merge request gets the report as a note and a status: see GitLab. |
Not yet: results fetched from another CI. See Other CI systems.
Requirements
For GitHub Actions:
- The eval workflow runs on
pull_requestand onpushto the default branch. Pull request runs get the comment. Default branch runs are the baseline that pull requests are compared against; without them, every pull request looks like a first run. - The eval command writes a results file: JUnit XML, promptfoo JSON, pytest-json-report JSON, Vitest or Jest JSON, an Inspect AI log or evalship JSON. See Result formats.
- An
actions/upload-artifact@v7step withif: always()uploads the file. Withoutif: always()the upload is skipped when an eval fails, which is the run you most want reported.
- uses: actions/upload-artifact@v7
if: always()
with:
name: evalship-results
path: eval-results.xml
Setup's workflow
The workflow setup writes has four parts of its own:
| Part | What it does |
|---|---|
A paths filter on pull_request |
Eval tests run only on pull requests that change what they test. On a repository with a review, a pull request the filter skips still gets a comment when it changes a prompt or AI call. To run the eval tests on every pull request, delete paths. |
A concurrency block |
It cancels a pull request's older run when you push again. Every other run gets a group of its own, so each push to the default branch keeps its results. If your workflow has its own group, cancel only pull request runs: cancel-in-progress: ${{ github.event_name == 'pull_request' }}. |
continue-on-error: true on the eval step |
The eval job stays green, and the evalship check decides. See Which check decides. |
A workflow_dispatch trigger |
You can run the eval tests on a branch by hand. See [Run evals when you want]. |
A branch rule that requires the eval job waits forever on a pull request the filter skips. Require the evalship check instead.
Which check decides
A workflow evalship's setup creates gives its eval step continue-on-error: true. The job stays green when an eval fails or flips, and evalship's evalship check decides whether a pull request broke the evals: it compares with the default branch and leaves out evals it has seen flip. To have the eval job itself fail instead, remove that line. A workflow you already had keeps its exit status.
Artifact names
The name evalship-results is recommended, not required. By default evalship reads an artifact when a word in its name or its workflow's name starts with "eval", or when it's the one your review names. Your unit tests' JUnit XML then isn't counted as eval tests.
To pick the artifacts yourself, list name globs in .evalship.yml:
results:
artifacts:
- evalship-results
- "evals-*"
What evalship reads
| Item | Limit |
|---|---|
| Artifact size | Up to 20 MB. Larger artifacts are skipped. |
| File types | .xml, .json and .eval files inside the artifact, or the artifact's one file when it's uploaded with archive: false. Other files are ignored. |
| Result file size | Up to 10 MB per file. |
| Evals per workflow run | Files are read until the run has 20,000 evals; the files after that are skipped. A file with more than 20,000 is skipped whole. |
.xml, .json and .eval files that aren't eval results, such as package.json or a coverage report, are skipped. If an artifact whose name contains eval, junit, result, test or promptfoo holds no readable result file, the dashboard shows "Eval runs aren't reaching evalship." with the workflow and artifact names.
To upload several files, list them or upload a directory:
with:
name: evalship-results
path: |
eval-results.xml
promptfoo-results.json
Examples
Add the env your eval tests need.
pytest
- run: pytest tests/evals --junitxml=eval-results.xml -o junit_family=xunit1
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- uses: actions/upload-artifact@v7
if: always()
with:
name: evalship-results
path: eval-results.xml
-o junit_family=xunit1 keeps record_property values in the XML, which is how scores and thresholds reach evalship. See Result formats.
promptfoo
- run: npx promptfoo@latest eval -c promptfooconfig.yaml --no-cache -o eval-results.json
- uses: actions/upload-artifact@v7
if: always()
with:
name: evalship-results
path: eval-results.json
--no-cache asks the model on every run. promptfoo caches model answers on disk for 14 days by default, so a workflow that keeps that cache between runs replays old answers.
Vitest
- run: npx vitest run evals --reporter=default --reporter=junit --outputFile.junit=eval-results.xml
- uses: actions/upload-artifact@v7
if: always()
with:
name: evalship-results
path: eval-results.xml
--reporter=default next to --reporter=junit keeps the usual console output. With --reporter=junit alone, the log only says where the report went.
Jest
Install jest-junit as a dev dependency.
- run: npx jest evals --ci --reporters=default --reporters=jest-junit
env:
JEST_JUNIT_OUTPUT_FILE: eval-results.xml
JEST_JUNIT_ADD_FILE_ATTRIBUTE: "true"
JEST_JUNIT_SUITE_NAME: "{filepath}"
JEST_JUNIT_CLASSNAME: "{classname}"
JEST_JUNIT_TITLE: "{title}"
- uses: actions/upload-artifact@v7
if: always()
with:
name: evalship-results
path: eval-results.xml
jest-junit's defaults put the describe block and the test name together in both the class name and the test name, leave out the file, and name a suite undefined when its file has no describe block. With these settings, each eval is known by its describe blocks and test name, in a suite named after its file. --reporters=default keeps the usual console output.
RSpec
Add gem "rspec_junit_formatter" to the test group of your Gemfile.
- run: bundle exec rspec spec/evals --format progress --format RspecJunitFormatter --out eval-results.xml
- uses: actions/upload-artifact@v7
if: always()
with:
name: evalship-results
path: eval-results.xml
Go
- run: go install github.com/jstemmer/go-junit-report/v2@latest
- run: go test -v ./evals/... 2>&1 | go-junit-report -set-exit-code > eval-results.xml
- uses: actions/upload-artifact@v7
if: always()
with:
name: evalship-results
path: eval-results.xml
Java
Maven writes a JUnit XML report for every test class without extra setup:
- run: mvn -B test -Dtest='*EvalTest'
- uses: actions/upload-artifact@v7
if: always()
with:
name: evalship-results
path: target/surefire-reports/*.xml
With Gradle, run ./gradlew test and upload build/test-results/test/*.xml. Kotlin tests write the same reports.
PHP
- run: vendor/bin/phpunit --log-junit eval-results.xml tests/Evals
- uses: actions/upload-artifact@v7
if: always()
with:
name: evalship-results
path: eval-results.xml
Rust
cargo test can't write JUnit XML on stable Rust, so run the eval tests with cargo-nextest and give it a report path in .config/nextest.toml:
[profile.ci.junit]
path = "junit.xml"
- uses: taiki-e/install-action@nextest
- run: cargo nextest run --profile ci --test evals
- uses: actions/upload-artifact@v7
if: always()
with:
name: evalship-results
path: target/nextest/ci/junit.xml
nextest's retries count once: a test that passes on a retry passes.
tinyeval
tinyeval runs eval tests from one bash file the repository commits, in any language, and writes evalship JSON:
- run: ./tinyeval -n 3
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
- uses: actions/upload-artifact@v7
if: always()
with:
name: evalship-results
path: eval-results.json
-n 3 runs each test case 3 times, and evalship reads the repeats as one eval. That is 3 times the model calls: Slow evals says when repeats pay.
Shell script
Eval tests can be a bash script with no framework at all. This one asks a command-line bot each question, checks the reply with grep and writes evalship JSON with jq, which GitHub's Ubuntu runners include:
#!/usr/bin/env bash
# evals/run.sh: each test case asks the bot one question and checks its reply with a pattern.
evals='[]'
check() { # key, question, pattern the reply must match
local reply passed=false
reply=$(./bin/support-bot "$2")
grep -qiE "$3" <<<"$reply" && passed=true
evals=$(jq -c --arg key "$1" --arg input "$2" --arg output "$reply" --argjson passed "$passed" \
'. + [{key: $key, input: $input, output: $output, passed: $passed}]' <<<"$evals")
}
check refund-above-limit 'Can I get a refund of $500?' 'colleague'
check order-status 'Where is order 1042?' '1042'
jq -n --argjson evals "$evals" '{suite: "support-bot", evals: $evals}' > eval-results.json
- run: bash evals/run.sh
- uses: actions/upload-artifact@v7
if: always()
with:
name: evalship-results
path: eval-results.json
Full workflow
A complete .github/workflows/evals.yml for a Python repository with main as the default branch:
name: evals
on:
pull_request:
paths:
- "tests/evals/**"
- "app/llm/**"
- "prompts/**"
- "requirements.txt"
- ".github/workflows/evals.yml"
push:
branches: [main]
workflow_dispatch:
# Cancel a pull request's outdated run; each push to the default branch keeps its own, the baseline evalship compares with.
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }}
cancel-in-progress: true
jobs:
evals:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- run: pip install -r requirements.txt
- run: pytest tests/evals --junitxml=eval-results.xml -o junit_family=xunit1
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
- uses: actions/upload-artifact@v7
if: always()
with:
name: evalship-results
path: eval-results.xml
Several workflows or artifacts
All artifacts from all workflow runs for the same commit SHA merge into one run. evalship processes it about 15 seconds after the latest artifact arrives; if another workflow finishes later, its results are added and the comment is updated. When two artifacts report the same suite and key, the one read last wins.
So slow evals can run in parallel jobs, as the next section says. The 20,000-eval limit counts every artifact in the workflow run together.
A push run on a branch with an open pull request counts for that pull request when the commit is the pull request's head.
Slow evals
An eval run spends most of its time waiting on the model, and test runners run test cases one at a time by default.
- Run test cases concurrently in the same job: pytest-xdist
-n 4, promptfoo--max-concurrency, andPromise.allorasyncio.gatherfor a test case's repeats. Your provider's rate limit sets how far this goes. Vitest's concurrent tests put a test's printed output under another test case in the JUnit report, so there, go to step 2. - If a run still takes more than 5 minutes, split the test cases across a
strategy.matrix. Give each job's upload its own name, such asevalship-results-${{ matrix.shard }}. A 16-minute job on 4 shards takes about 4 minutes, for the same number of model calls. Split by test case, not by file: vitest's and jest's--shardsplit by file, so one big file keeps the whole run waiting on its job. Check that the jobs together run every test case once.
Each shard repeats the job's setup, and GitHub bills each job by the started minute, so those 4 shards bill about 20 minutes, not 16. On a private repo they come out of your plan's Actions minutes; public repos run free.
Repeats multiply a run's time and its model calls, so repeat only the test cases that flip, such as one where variety is the point, like a tweet. Run those 3 or more times with the same name and input (promptfoo --repeat; tinyeval's -n repeats every test case of its run). evalship reads the repeats as one eval, which passes when at least half of them pass, so it can tell a drop from chance. Without repeats, evalship lists an eval that flips as flaky and sets it aside on pull requests (see Checks).
Run evals when you want
Setup's workflow also has a workflow_dispatch trigger, so you can run the eval tests on a branch once it's ready: in the Actions tab under Run workflow, or with gh workflow run evals.yml --ref BRANCH. The results go to the pull request whose head is that commit, as a push's do. To run them only then, delete the pull_request trigger and keep push to the default branch for the baseline.
Run evals on your machine
To keep your model keys off GitHub, run the eval tests yourself and send the results file. The first time, your coding agent opens an evalship page where you approve it, and keeps its upload token in ~/.config/evalship/token. Without an agent, make a token in Settings and save it as EVALSHIP_TOKEN. Push the commit, then from the repository:
curl --fail-with-body -sS https://evalship.com/api/v1/results \
-H "Authorization: Bearer $EVALSHIP_TOKEN" \
-F repository=OWNER/REPO \
-F sha=$(git rev-parse HEAD) \
-F branch=$(git branch --show-current) \
-F file=@eval-results.xml
Send each results file in its own request. evalship treats them as CI's: a default branch commit's results are the baseline, and a pull request's head commit gets the check and comment, which say who ran them. Run them on a clean working tree, since the results count for the commit.
Setup makes the eval tests load their model key the way your app does, following what your repository says about its secrets: an env file, direnv or a secrets manager. Your coding agent's commands never open that file, and it never asks for the key in chat. If the machine has no key, it asks you to add it where your repository keeps its keys.
Your coding agent can send the default branch's first: ask it Connect this machine and run evalship's evals for the default branch: https://evalship.com/pr.md?repo=OWNER/REPO. Setup offers the same when your eval tests need a key the repository doesn't have. From then on the repository runs its eval tests on your machines, until a member sets Eval runs to GitHub Actions in its Settings. A pull request that changes prompts, AI calls or eval tests gets a comment right after each push with one line to give your coding agent. The agent checks out the pull request, runs the eval tests the way your workflow does and sends the results, and the comment becomes the report. When a pull request merges without changing the code its eval tests ran on, its results count for the default branch too, so nobody runs them again. If the default branch moved on in between, the merge commit's code is new: run them there.
There your coding agent writes the pull request's notes too, on your own model plan, so no excerpt of the change goes to evalship's model. It gets the instructions this change needs, writes the notes on its checkout and sends them; evalship drops any it can't check against the diff, as it does its own model's, and the comment says whose agent wrote them. Then the agent tells you what the pull request's check says, such as "2 regressions in support-bot", and offers to fix them on the branch.
CI's default branch results still count, so pull requests may compare against a run without your keys. Settings warns when CI sends them: run the eval workflow only on: workflow_dispatch.
A token sends results to every repository you can push to on GitHub, and to your organizations' repositories set up without it. Settings lists yours, with when each was last used; revoking one stops it.
Without GitHub
Paste the setup line into your coding agent and sign in, which connects the repository. That goes for GitLab, another host and no remote, and for GitHub too: setup starts without the GitHub App and offers its pull request checks at the end. evalship reads nothing from the repository, so each upload carries the commit's tree, and the default branch's carry .evalship.yml:
curl --fail-with-body -sS https://evalship.com/api/v1/results \
-H "Authorization: Bearer $EVALSHIP_TOKEN" \
-F repository=ORGANIZATION/REPO \
-F sha=$(git rev-parse HEAD) \
-F tree=$(git rev-parse "HEAD^{tree}") \
-F branch=$(git branch --show-current) \
-F config=@.evalship.yml \
-F file=@eval-results.xml
Your coding agent checks each change before it finishes, and its reply has the verdict.
After a merge, the same request for the default branch's new commit without the file line makes the merged change's results count for it, so nobody runs the eval tests again. That holds when the merge left the code the eval tests ran on and they ran every suite. Otherwise evalship answers 404: run them on the default branch.
To send no code at all, turn on Keep code on your machines in the repository's Settings. Each change then sends the names of its changed files and their changed line numbers, never its diff: see Keep code on your machines.
GitLab
Connect a gitlab.com project in the repo's Settings, and each merge request gets evalship's report as a note and a status. The eval tests run on your machine until the eval job in GitLab CI sends the default branch's results, which moves merge requests to GitLab CI. Switch either way under Eval runs in Settings.
The connection needs a token with the Maintainer role, since only a Maintainer can add the webhook. On any plan, make a fine-grained personal access token limited to this project, with these permissions:
- Read: Repository, Commit, Branch, Merge Request, User, Pipeline, Job and Job Artifact
- Run: Job, so evalship can run the eval job once more when a failure may be chance
- Read and Update: Project, so evalship can turn on Pipelines must succeed
- Create: Commit Status
- Create, Read and Delete: Webhook
- Create, Read, Update and Delete: Work Item, which covers merge request notes
On Premium or Ultimate, a project access token with the api scope works too. Either reaches only this project.
evalship stores the token encrypted and deletes it when you disconnect. A token lasts up to a year, and GitLab emails you before it expires. Once GitLab stops accepting it, evalship emails the owners and keeps recording results until someone pastes a new one in Settings.
A token made before November 13, 2026 lacks Pipeline, Job, Job Artifact and Update on Project, and its webhook doesn't send job events. Paste a new token in Settings: connecting again replaces the webhook. A token without Run on Job still works: evalship then leaves running the eval job again to you.
A gate in .evalship.yml fails the merge request's evalship status. evalship posts the status into the merge request's pipeline, and turns on Pipelines must succeed in the project's merge request settings when merge requests move to GitLab CI, so a failing gate blocks the merge. If the token can't change that setting, Settings links it. See Configuration.
Evals in GitLab CI
When a job ends, evalship reads the result files in its artifacts: JUnit XML, promptfoo or evalship JSON, as on GitHub. The job also saves the commit's tree as evalship-tree.txt, which tells evalship two runs tested the same code.
evals:
stage: test
allow_failure: true # evalship's status says whether the evals passed
script:
- git rev-parse "HEAD^{tree}" > evalship-tree.txt
- npm run evals -- --reporter junit --output eval-results.xml
artifacts:
when: always
paths: [eval-results.xml, evalship-tree.txt]
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes: [prompts/**/*, evals/**/*, .gitlab-ci.yml]
interruptible: true
The default branch's runs become the baseline merge requests compare with. If your project runs branch pipelines rather than merge request pipelines, the second rule is if: $CI_COMMIT_BRANCH with changes: comparing to the default branch (compare_to: refs/heads/main): a merge request pipeline would take the place of the branch pipeline that runs your tests. Not yet: merged results pipelines, whose commit isn't the merge request's.
Keep model keys in masked CI/CD variables with Protect variable off: merge request pipelines run on branches that don't get protected variables. results.artifacts in .evalship.yml names the jobs to read on GitLab. Update setup in Settings gives your coding agent the line that adds this job.
Before you finish
Your coding agent can run the eval tests a change affects before it's done, as it runs the tests, committed or not. Before it opens the pull request, it also checks the change by evalship's current rules, so the check doesn't find the flaws first. Put this line in the repository's AGENTS.md, CLAUDE.md or other agent instructions. Setup adds it, and creates an AGENTS.md when the repository has none, unless you say no:
In OWNER/REPO, before you finish a change to a prompt, a model, an LLM call or the evals, and before you open its pull request, follow https://evalship.com/change.md?repo=OWNER/REPO, which sends evalship the change's diff with its results
The agent sends the change's diff from your machine, and evalship answers which suites it affects, so it runs only those, or none. With none to run, it still sends the diff for its notes, with the pull request's title and description when it's about to open one. Its results are compared with the default branch, and evalship reviews the change as it would its pull request, so the agent fixes the flaws before one is open. Where your coding agent writes the notes (your eval tests run on your machines, or Model notes is off), it writes these too. Its run says whose machine it came from, and evalship deletes the diff after 7 days, or once the commit reaches GitHub. When you commit and push the same code, the pull request takes that run, with its report and notes, and nothing runs again. Pushed straight to the default branch, it becomes that commit's run when your agent checks its next change, if it ran every suite. This works whether the repository's eval tests run in GitHub Actions or on your machines.
A repository set up before this gets it from Update your setup on its Settings page, which gives your coding agent one line for every change setup has made since.
API keys
Your eval tests call your model provider with your own key, saved as an Actions secret. If they call Claude, a Claude Max, Ultra or Team plan includes $100 to $500 a month of API credit: link a Console organization in claude.ai under Settings > Billing and use a key from that organization (how, and what a run costs). When the credit runs out and the organization has no other, calls stop until next month's arrives, and evalship shows those evals as couldn't run, not as failures.
Fork pull requests
Fork pull requests work without extra setup. GitHub doesn't pass your Actions secrets to workflows triggered from forks or by Dependabot. If your eval tests call a paid API, they fail on those pull requests and evalship would report those failures as regressions. To skip eval tests there, add a condition to the job:
jobs:
evals:
if: github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.login != 'dependabot[bot]')
Those pull requests then get no results, and a comment only if they change prompts or AI calls, saying no eval ran.
evalship skips results from pull_request_target workflows. GitHub files those runs under your default branch's latest commit, so a fork's results would read as your default branch's.
Timing and retention
evalship downloads artifacts when the completed event arrives, usually within seconds of the run finishing, and stores the parsed results. Your repository's artifact retention setting doesn't matter after that. Artifacts that have already expired when the event arrives are skipped.
Re-running the workflow uploads new artifacts and updates the results for the commit. Re-running the evalship check from GitHub re-processes the stored results without downloading anything.
Other CI systems
evalship fetches results itself from GitHub Actions and GitLab CI. Not yet: results fetched from another CI.
Until then, your coding agent [runs the eval tests on your machine]. A repository off GitHub starts at Without GitHub.
A job in another CI can send its results file with the same curl, with an upload token saved as a secret there. evalship counts that job as one of your machines:
- The report names the token's owner as who ran the evals.
- The token reaches every repository its owner can send results to.
- Each pull request's notes wait for a coding agent to write them.
A CI checkout often has no current branch, so git branch --show-current prints nothing there. For a repository off GitHub, send the branch from your CI's own variable, such as -F branch=$BUILDKITE_BRANCH on Buildkite. Without it, the default branch's results don't become the baseline.
Troubleshooting
| Symptom | Likely cause |
|---|---|
No comment and no evalship check |
The workflow didn't run for the commit, the upload step is missing or lacks if: always(), the artifact is over 20 MB, the results file isn't .xml, .json or .eval, or results.artifacts excludes the artifact name. |
| A check but no comment | The pull request is closed, comment.enabled is false, the results are for an older commit than the pull request's head, or the repository is private and locked (past Free's one private repository) or on Free with more than two users. See Pricing and billing. |
| Every comment says it's the first run | No completed run on the default branch. Add the push trigger for the default branch and merge. |
| Evals show up as removed and new on every run | Eval keys change between runs. See stable keys in Result formats. |