What CI for a monorepo costs on GitHub Actions
A monorepo puts many packages behind one set of workflows. The simple setup runs a job for every package on every push, whatever the push changed, and the minutes grow with the number of packages times the number of pushes. This page prices that setup against running only the affected packages, with this site's calculator.
The workload
- A private monorepo with 12 packages on GitHub Team, which includes 3,000 minutes a month.
- 30 pushes per working day across the team, 22 working days a month.
- One job per package, 5 billed minutes each, on Linux 2-core x64.
- Compute only: seats, storage and taxes are not in the figures.
Every package on every push, or only what changed
With a job for all 12 packages, one push is 60 minutes of CI, $0.36 at the Linux 2-core rate. If path filters or a build tool that knows the dependency graph cut that to the 3 packages a typical push affects, it is 15 minutes and $0.09. Over a month:
| Jobs per push | Jobs per day | Minutes per month | Minutes billed | Cost per month | Cost per year |
|---|---|---|---|---|---|
| 12 jobs per push | 360 | 39,600 | 36,600 | $219.60 | $2,635.20 |
| 6 jobs per push | 180 | 19,800 | 16,800 | $100.80 | $1,209.60 |
| 3 jobs per push | 90 | 9,900 | 6,900 | $41.40 | $496.80 |
| 1 job per push | 30 | 3,300 | 300 | $1.80 | $21.60 |
Running all 12 packages costs $219.60 a month. Running the 3 that a push affects costs $41.40, a saving of $178.20 a month and $2,138.40 a year. The saving is larger than the drop in minutes suggests, because the 3,000 included minutes are a fixed amount: they cover under a tenth of the full run and almost a third of the filtered one.
The average number of affected packages is the figure to find out for your own repository. A change to a shared library that every package depends on still runs everything, so the real average sits above the typical push.
Small packages and the one-minute floor
GitHub rounds every job up to a whole minute. Twelve packages whose checks take 40 seconds each are 8 minutes of work and 12 billed minutes per push when each has its own job. Small packages are cheaper checked together in one job; a job per package pays off for the slow ones, where running in parallel shortens the wait.
A monorepo that also holds an app
Monorepos often mix platforms: services on Linux, a desktop client on Windows, a mobile app on macOS. Take the same 12 jobs per push, with 10 on Linux 2-core x64, 1 on Windows and 1 on macOS. The calculator shares the included minutes between the runners in proportion to their minutes.
| Runner | Minutes | Included minutes used | Minutes billed | Cost per month |
|---|---|---|---|---|
| Linux 2-core, x64 | 33,000 | 2,500 | 30,500 | $183.00 |
| Windows 2-core | 3,300 | 250 | 3,050 | $30.50 |
| macOS | 3,300 | 250 | 3,050 | $189.10 |
| Total | 39,600 | 3,000 | 36,600 | $402.60 |
The same number of minutes now costs $402.60 a month, $4,831.20 a year. The macOS job is one job in twelve and $189.10 of the bill, more than the ten Linux jobs together. Depending on which jobs happen to use the allowance first, the calculator puts the month between $249.60 and $417.60.
This is where path filters earn the most. A macOS job that runs only when the app's own directory changes stops being charged for every backend push.
Other plans and public monorepos
The full 39,600 minutes fit inside the 50,000 that GitHub Enterprise Cloud includes: on standard runners they cost $0.00 there, with 10,400 minutes left. In a public repository standard runners are free whatever the number of packages.
Price your own monorepo. Multiply your pushes per day by the jobs an average push starts, then enter that with your average job length in the free calculator.