How CI Router works

What happens to a job from the moment GitHub queues it until its machine is destroyed.

#The path of one job

  1. GitHub queues a job whose runs-on line is ci-router. The GitHub App tells CI Router.
  2. CI Router checks that your team can pay for the job: the usage included in your plan, or credit you bought.
  3. CI Router reads what the job needs from its labels and its workflow. It picks a provider and a size among the machines that have it.
  4. A fresh machine boots with a runner registered for this one job. If the machine fails to boot, CI Router tries the next provider.
  5. The runner takes the job and runs it. Logs, artifacts and checks go to GitHub, as with any runner.
  6. When the job ends, the runner reports the CPU and memory the job used. The machine and its disk are destroyed.
  7. The job is charged for the machine's lifetime, per second where the provider supports it. See Plans and credit.

#How the route is chosen

A route is a provider and a size. CI Router picks one for each job, among your allowed providers and the machines that have what the job needs. The mode decides whether cost or speed comes first. A size tag fixes the size. See Modes and sizes.

A job's first route comes from its mode and what it runs, such as a compile or a lint. CI Router then measures every run. It moves the job when another route measures faster or cheaper, or when a run runs out of memory or disk. Each change is listed on the run's Routing tab. See Runs and diagnostics.

#When a job does not start

Some jobs cannot run: funds are missing, public repositories are off, or no allowed machine has what the job needs. CI Router starts no machine for them. The job stays queued on GitHub and nothing is charged. The dashboard's Runs page shows the reason. See Troubleshooting.

When no provider can boot a machine, CI Router keeps retrying. If none succeeds, it holds the job and the dashboard shows a notice. Re-run the job when a provider is back.

#Terms

Terms used in these docs
TermMeaning
JobOne job of a GitHub Actions workflow that asked for a ci-router runner.
RunOne attempt to run a job on a machine. A job that is retried has several runs.
RouteThe provider and size a job runs on.
Modecheap, auto, fast: whether a job favors cost, a balance, or speed.
TeamYour GitHub organizations, members, API keys, settings and billing.
How CI Router works | CI Router docs