GitHub Actions Runners

A runner is the machine that actually executes your workflow. When GitHub Actions starts a job, it finds an available runner, sends your instructions to it, and the runner carries them out step by step. Understanding runners helps you choose the right machine for each job and keep your workflows fast and cost-effective.

What a Runner Actually Is

A runner is a virtual machine — a computer that exists only in the cloud. GitHub creates it fresh for each job, runs all your steps on it, and then shuts it down when the job ends.

Job starts
    ↓
GitHub provisions a fresh virtual machine
    ↓
Runner downloads your workflow steps
    ↓
Steps execute one by one
    ↓
Job finishes
    ↓
Virtual machine is deleted permanently

Because runners start fresh every time, you cannot rely on files or software from a previous run. Each run is completely isolated from all other runs.

GitHub-Hosted Runners

GitHub provides ready-to-use runners that you can access immediately — no setup required. You pick one by specifying its label in the runs-on field of your job.

Available GitHub-Hosted Runner Types

Label                  | Operating System | CPU Cores | RAM
-----------------------|------------------|-----------|------
ubuntu-latest          | Ubuntu Linux     | 4         | 16 GB
ubuntu-22.04           | Ubuntu 22.04     | 4         | 16 GB
windows-latest         | Windows Server   | 4         | 16 GB
macos-latest           | macOS            | 3         | 14 GB
macos-13               | macOS 13         | 3         | 14 GB

Ubuntu is the most popular choice because it is fast, widely compatible, and costs the least in terms of included minutes.

Minute Multipliers for Private Repos

GitHub counts runner minutes differently depending on the operating system. For private repositories:

Ubuntu   → 1x  (1 minute costs 1 minute)
Windows  → 2x  (1 minute costs 2 minutes)
macOS    → 10x (1 minute costs 10 minutes)

A 10-minute job on macOS consumes 100 minutes from your plan's quota. Always use Ubuntu unless your project specifically requires Windows or macOS.

Pre-installed Software on Runners

GitHub-hosted runners come with popular tools already installed. You do not need to install these manually:

  • Node.js, Python, Ruby, Java, Go, .NET
  • Git, Docker, npm, pip, Maven, Gradle
  • curl, wget, zip, jq
  • AWS CLI, Azure CLI, Google Cloud SDK (on some runners)

The full list of pre-installed software for each runner type is available in the GitHub documentation. You can also add any missing software by running install commands in your workflow steps.

Choosing the Right Runner

What does your project need?
          │
          ├── Runs on any OS → Use ubuntu-latest
          │
          ├── Must test on Windows → Use windows-latest
          │
          ├── Builds a macOS or iOS app → Use macos-latest
          │
          └── Needs private network or custom tools → Use self-hosted runner

Setting the Runner in Your Workflow

Each job sets its own runner independently. Jobs in the same workflow can run on different operating systems:

jobs:
  test-on-linux:
    runs-on: ubuntu-latest
    steps:
      - run: echo "Testing on Linux"

  test-on-windows:
    runs-on: windows-latest
    steps:
      - run: echo "Testing on Windows"

  test-on-mac:
    runs-on: macos-latest
    steps:
      - run: echo "Testing on macOS"

All three jobs start at the same time on their respective runners. This is how teams test cross-platform compatibility automatically.

Runner Labels for Larger Runners

GitHub also offers larger runners with more CPU and RAM for organizations that need extra power. These are available on paid plans and use labels like:

  • ubuntu-latest-4-cores
  • ubuntu-latest-8-cores
  • ubuntu-latest-16-cores

Use larger runners for heavy tasks like compiling large codebases, training machine learning models, or running hundreds of tests at once.

Self-Hosted Runners

A self-hosted runner is a machine you own and manage yourself. You install the GitHub Actions runner software on it, connect it to your GitHub account, and GitHub sends jobs to it.

GitHub-Hosted Runner          Self-Hosted Runner
─────────────────────         ─────────────────────
Managed by GitHub             Managed by you
Fresh machine every run       Persistent machine
Limited customization         Full control
No network restrictions       Access private networks
Cost per minute               You pay for hardware

Self-hosted runners are covered in detail in a later topic. For now, know that they exist and that you specify them with the self-hosted label:

jobs:
  deploy:
    runs-on: self-hosted
    steps:
      - run: echo "Running on my own machine"

Runner Groups

Organizations can organize self-hosted runners into groups. A group might contain all runners for the production environment, or all runners for a specific team. You assign a job to a group by listing the group label alongside self-hosted:

runs-on:
  - self-hosted
  - production
  - linux

GitHub picks any available runner that matches all three labels. This gives you load balancing across multiple machines without hardcoding a specific runner name.

Leave a Comment

Your email address will not be published. Required fields are marked *