Inngest CI concepts

Learn the parts of a pipeline: what starts it, what it calls, where commands run, and how results are reported.

Inngest CI is an Inngest Labs project: early, moving fast, and shaped by your feedback. What's Labs?

Every Inngest CI run follows the same pattern: trigger → pipeline → jobs → commands → checks. Each section below defines one part with the smallest code that shows it. The quick start puts them together in a working pipeline.

Pipeline

A pipeline runs when something happens and calls jobs. It is one Inngest function, so every flow control option works on it. See Pipelines and triggers.

TypeScript
export const pr = ci.pipeline(
  {
    id: "pr",
    on: github.pullRequest(),
  },
  async () => {
    await test();
  },
);

Trigger

A trigger starts a pipeline and types its event. Triggers include GitHub pull requests and pushes, comments, the merge queue, cron, and manual events. See Triggers.

TypeScript
on: [github.pullRequest(), github.push({ branches: ["main"] })]

Job

A job is a unit of work with its own machine and its own check. You call it like a function, and it resolves when the job finishes. See Jobs.

TypeScript
const test = ci.job("test", async () => {
  await checkout();
  await $`pnpm test`;
});

Command

A command is a shell command that runs on the job's machine with $. Each command is a step, so a retry skips commands that already finished. See Commands.

TypeScript
await $`pnpm test`.retries(1);

Machine

A machine is a Sandbox: an ephemeral Linux microVM. A job gets one when it runs its first command. Only commands run on the machine. The rest of your handler runs in your app. See Machines.

TypeScript
const build = ci.job({ id: "build", machine: { vcpu: 4 } }, async () => {
  await checkout();
  await $`pnpm build`;
});

Starting from another job

from(job) starts the current job on a copy of another job's machine. The parent runs once, however many jobs start from it. See Start a job from another job.

TypeScript
const lint = ci.job("lint", async () => {
  await from(base);
  await $`pnpm lint`;
});

Cache

A job's cache skips the job when nothing it depends on has changed. Inngest restores the saved machine instead of running the job again. See Caching.

TypeScript
const base = ci.job(
  { id: "base", cache: { key: files("pnpm-lock.yaml") } },
  async () => {
    await checkout();
    await $`pnpm install`;
  },
);

Jobs that start from a cached base call checkout() again, so they test this run's commit.

Check

A check reports a pipeline or a job on GitHub. Each pipeline gets one check, and each job gets one. You can add a summary or annotations from code. See Checks and reports.

TypeScript
await report.summary("Coverage: **91%**");

Next steps