Skip to main content
Run Momentic on Buildkite with the example pipeline below. More reference configs live in momentic-ai/examples. Buildkite is auto-detected, so Momentic reads git metadata (branch, commit, pipeline) from the agent. Given this root package.json:
package.json
Create a file called .buildkite/pipeline.yml in your repository with the following contents:
.buildkite/pipeline.yml

Authentication

To run any commands, you must authenticate with Momentic by providing the MOMENTIC_API_KEY environment variable.
  1. Create an API key in the Momentic dashboard.
Copy the value. You add it as a CI secret in the next step.
  1. Store it with the Buildkite secrets tooling your agents use: the secrets Buildkite plugin, your secrets manager, or an agent environment hook. Do not commit it to the pipeline file.
  2. Expose it to the momentic steps as MOMENTIC_API_KEY:
.buildkite/pipeline.yml

Sharding

If you have a large test set, use sharding to run tests in parallel across CI jobs and shorten total run time. Buildkite exposes the parallel job index as BUILDKITE_PARALLEL_JOB (0-indexed) and the total as BUILDKITE_PARALLEL_JOB_COUNT. Momentic’s --shard-index is 1-indexed, so add one. To collect every shard into a single run group in the dashboard, add a step that merges and uploads results after the tests finish.
.buildkite/pipeline.yml

Test Analytics

Momentic can emit a Buildkite-format JSON report with the buildkite-json reporter for Buildkite Test Analytics: