Run SurrealKit tests in CI pipelines using the official GitHub Action, with JSON output for test reporting and Docker Compose for full end-to-end environments.
Tests exit non-zero on any failure, produce machine-readable JSON output, and there is an official GitHub Action that handles installation and execution.
JSON output
Pass --json-out to write a structured report alongside the human-readable output:
surrealkit test --fail-fast --json-out results.json
The JSON file can be consumed by CI reporting tools or used for dashboards and notifications.
GitHub Actions
The surrealkit-action installs the SurrealKit CLI and runs any SurrealKit command. It supports Linux x64, macOS ARM64, and Windows x64.
The database/ directory is mounted read-only; the container reads your schema files and test suites but cannot write back to them. The JSON report is written to database/results.json on the host.
Seeding before tests
SurrealKit runs a setup phase before executing tests. By default this includes syncing your schema and running any seed files. To skip individual phases:
surrealkit test --no-sync # skip schema sync, use whatever is already in the DB surrealkit test --no-seed # skip seed data
In most CI environments you want both phases to run so each test job starts from a clean, consistent state.