DevTools Logo

GitHub Actions Matrix & Runner Budget Calculator

GitHub Actions Matrix & Runner Budget Calculator

Expand strategy.matrix with exclude and include rules, then estimate runner minutes.

Runs in your browser
Try an example

Matrix inputs

JSON, same shape as strategy.matrix

Combinations

16 jobs · 4 waves
Waves assume every job takes the same time. Minutes are rounded up per job; multipliers are Linux 1x, Windows 2x, macOS 10x for GitHub-hosted runners. Public repositories are free.

16 combinations · 4 execution waves

Within the 256-job limit
128 billed minutes
592 weighted minutes
2 excluded
#osnodebrowserexperimental
1ubuntu-latest18chromium—
2ubuntu-latest18firefox—
3ubuntu-latest20chromium—
4ubuntu-latest20firefox—
5ubuntu-latest22chromiumtrue
6ubuntu-latest22firefoxtrue
7macos-latest18chromium—
8macos-latest18firefox—
9macos-latest20chromium—
10macos-latest20firefox—
11macos-latest22chromium—
12macos-latest22firefox—
13windows-latest20chromium—
14windows-latest20firefox—
15windows-latest22chromium—
16windows-latest22firefox—

Examples

Exclude before partial-match include

Input
calculateMatrix({ variables: { os: ["ubuntu", "windows"], node: [18, 20] }, exclude: [{ os: "windows", node: 18 }], include: [{ os: "macos", node: 22 }] })
Output
3 base rows minus 1 excluded, plus 1 appended macos row; excludedCount: 1

The windows/node-18 row is pruned first; the macos addition conflicts with every surviving row so it appends instead of merging.

macOS cost weighting

Input
calculateMatrix({ variables: { os: ["ubuntu", "windows", "macos"] }, minutesPerJob: 5 })
Output
billedMinutes: 15, weightedMinutes: 65 (5 + 10 + 50)

Each 5-minute job bills 5 minutes but weights to 1x, 2x, and 10x by runner OS.

About this tool

GitHub Actions Matrix Calculator expands variables with calculateMatrix(input): every key's value list crosses into the full cartesian product (empty value lists are dropped), totalBeforeRules records the pre-rule count, then exclude rules apply first via partial matching — a rule like { os: "windows", node: 18 } removes every combination containing at least those keys — and excludedCount reports how many rows disappeared.

Include rules apply second with GitHub's partial-match semantics: an addition merges (canMerge) into every existing row it does not conflict with, gaining its extra keys, and only appends as a brand-new row when it matches nothing (e.g. { os: "macos", node: 22 } beside ubuntu/windows rows). The result also carries waves (ceil(combos / concurrency), 0 when empty), billedMinutes (rows × minutesPerJob), and overLimit (true above 256 combinations).

Cost weighting follows the runner in each row (os, runner, or runs-on, defaulting to linux): linux/ubuntu count 1x, windows 2x, macos/mac 10x, anything else 1x, summed into weightedMinutes. Concurrency floors to at least 1 and minutesPerJob to at least 0, and formatCombination(combination, keys?) renders a row as key=value pairs joined with ·.

How to use this tool

  1. Define the axes

    Pass variables such as { os: ["ubuntu", "windows"], node: [18, 20] } — the tool builds all 4 combinations before rules run.

  2. Exclude first, then include

    List exclude rules to prune rows by partial match, then include rules to enrich matching rows with extra keys or append entirely new rows.

  3. Size the run

    Set concurrency and minutesPerJob to read waves, billedMinutes, and the macOS-weighted weightedMinutes; keep combos at or below 256 to clear overLimit.

Use cases

Previewing matrix size before pushing

Expand variables locally and confirm the combo count stays under GitHub's 256 limit instead of discovering it in CI.

Estimating runner spend

Compare weightedMinutes across linux, windows, and macos axes to decide which OS entries earn their 2x/10x multiplier.

Debugging exclude/include interplay

Verify that excludes prune by partial match and that includes merge into compatible rows rather than duplicating them.

Common mistakes

Mistake:Assuming include always adds a new job.

Fix:An include whose keys are compatible with existing rows merges into all of them (e.g. { experimental: true } enriches rather than appends) — only conflicting additions create new rows.

Mistake:Expecting exclude to require a full-row match.

Fix:Excludes are partial: { node: 18 } removes every combination with node 18 regardless of OS, which can empty the whole matrix.

Mistake:Budgeting macOS jobs at face minutes.

Fix:macos/mac runners weight 10x and windows 2x in weightedMinutes — read that field, not billedMinutes, for cost planning.

Frequently asked questions

What does this tool do?

It expands your matrix variables into every combination, applies exclude rules first (partial match) and include rules second (merge-or-append), then reports totalBeforeRules, excludedCount, waves from your concurrency, billedMinutes, OS-weighted weightedMinutes, and whether you exceed the 256-combination limit.

Why did my include add keys to existing jobs instead of creating a new one?

Includes use partial-match semantics: an addition compatible with a row merges into it (e.g. { experimental: true } enriches every matching job), and only conflicting additions — like a new macos OS value — append as fresh rows. That mirrors how GitHub Actions include blocks behave.

Is my workflow data uploaded or stored?

No. The cartesian expansion, rule matching, and cost math run entirely in your browser — nothing you enter is sent anywhere.

How should I read weightedMinutes versus billedMinutes?

billedMinutes is rows × minutesPerJob at face value; weightedMinutes multiplies each job by its runner cost (linux/ubuntu 1x, windows 2x, macos/mac 10x). A 5-minute macOS job bills 5 minutes but weights 50 — use weightedMinutes for cost planning.

References & standards