Interview Prep/CI/CD/GitHub Actions

A matrix of 40 jobs is eating minutes. How do you control cost?

IntermediateScenarioGitHub Actions
Answer

Situation read → Over-broad matrix.

What I'd do →

  1. Run the full matrix only on main and nightly; on PRs run one representative combination using if or dynamic matrix from a previous job.
  2. Use strategy.fail-fast: true and max-parallel where useful.
  3. Use exclude, path filters and caching, and cancel redundant runs with concurrency.

Why → Most regressions are caught by a small set; the rest can be post-merge.

Interview tip → Cost is a CI design constraint.

All CI/CD questions

More on GitHub Actions