Recipes

Common Inngest CI tasks, with the code for each and the page that explains it.

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

Services and waiting

TaskCodeLearn more
Start a serverconst server = await $`pnpm start`.background()Reference
Wait for a portawait waitForPort(3000)Reference
Wait for a health checkawait waitForHttp("http://127.0.0.1:3000/health")Reference
Read server logsawait server.output()Reference
Stop a serverawait server.kill()Reference
Wait for other checksawait github.waitForChecks({ names: ["vercel"] })Reference
Wait for an Actions workflowawait github.waitForWorkflow({ workflow: "npm_test.yml" })Reference
Run another pipelineawait step.invoke("contracts", { function: contracts, data: { sha } })Jobs

Tests

TaskCodeLearn more
Build once, test manyawait from(build)Machines
Skip unchanged testscache: { key: files("src/**", "test/**") }Caching
Retry a flaky commandawait $`pnpm test`.retries(2)Commands
Test every Node versionci.matrix over axes: { node: ["20", "22"] }Jobs
Dump state when a command hangsawait $`pnpm test`.timeout("10m").onTimeout(async () => { return $`ps auxf`; })Reference

Pull requests

TaskCodeLearn more
Post a sticky commentawait github.stickyComment("preview", `Preview: ${url}`)Reference
Annotate the diffawait report.annotate([{ path, line, message }])Checks and reports
Add a check summaryawait report.summary("**Coverage:** 91%")Checks and reports
Open or update a pull requestawait github.upsertPullRequest({ head: "release/next", title, body })Reference
Alert on a broken mainA pipeline on github.checkSuite({ branch: "main" })Pipelines

Changes and triggers

TaskCodeLearn more
Run on changed filesif (await changed("docs/**")) { await docsSite(); }Pipelines
Skip a whole runreturn ci.skip("nothing changed")Pipelines
Watch another repositoryon: github.push({ repo: "inngest/inngestgo", branches: ["main"] })Pipelines
Slash commandson: github.comment({ command: "/prerelease", minPermission: "write" })Pipelines
Typed manual runson: ci.manual({ pipelineId: "deploy", schema })Reference
Move a branch with no machineawait github.forcePushRef("heads/next", sha)Reference
Cancel superseded runssingleton: { key: "event.data.pull_request.number", mode: "cancel" }Pipelines

Debugging

TaskCodeLearn more
Keep a failed machineci.job({ id: "test", keepOnFailure: "24h" }, fn)Reference
Name a command in the traceawait $`pnpm test`.as("unit tests")Commands
Turn off a job's checkci.job({ id: "notify", check: false }, fn)Checks and reports
Rename the pipeline checkcheck: { name: "CI" }Pipelines

Next steps