Skip to main content
Example pipeline for running Momentic on Buildkite. More reference configs live in momentic-ai/examples. Buildkite is auto-detected, so Momentic reads git metadata (branch, commit, pipeline) from the agent automatically. For a given 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 and copy the value.
  2. Store it as a secret with the Buildkite secrets tooling your agents use (the secrets Buildkite plugin, your secrets manager, or an agent environment hook). Avoid committing it to the pipeline file.
  3. 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-flavored JSON report with the buildkite-json reporter for Buildkite Test Analytics: