Interview Prep/CI/CD/GitHub Actions

You want to run CI on macOS and Windows only for the release branch.

BeginnerScenarioGitHub Actions
Answer

Situation read → Costly runners for narrow use.

What I'd do →

  1. Use runs-on: ${{ matrix.os }} with os: [ubuntu-latest, macos-latest, windows-latest].
  2. Gate expensive OSes: include them only when startsWith(github.ref, 'refs/heads/release/') via a dynamic matrix.

Why → macOS minutes cost several times more than Linux, so use them where they add value.

Interview tip → Linux for fast feedback, others for compatibility confidence.

All CI/CD questions

More on GitHub Actions