GitHub Actions Tutorial — GitHub-Hosted Runners

2 minute read

GitHub-Hosted Runners

GitHub provides free virtual machines (runners) that execute your workflow jobs. Each job gets a fresh, clean VM — nothing persists between jobs or workflow runs.


Available Runners

Label OS Architecture
ubuntu-latest Ubuntu 22.04 x64
ubuntu-24.04 Ubuntu 24.04 x64
ubuntu-22.04 Ubuntu 22.04 x64
windows-latest Windows Server 2022 x64
windows-2022 Windows Server 2022 x64
macos-latest macOS 14 (Sonoma) arm64 (M1)
macos-14 macOS 14 (Sonoma) arm64 (M1)
macos-13 macOS 13 (Ventura) x64 (Intel)

Tip: ubuntu-latest is the most common choice. It’s the cheapest (1× minute multiplier), has the most pre-installed tools, and starts the fastest.


Hardware Specs

Runner CPUs RAM Storage
Linux 4 vCPUs 16 GB 14 GB SSD
Windows 4 vCPUs 16 GB 14 GB SSD
macOS 3 vCPUs (M1) 7 GB 14 GB SSD

Pre-Installed Software

GitHub-hosted runners come with a rich set of pre-installed tools:

Ubuntu Runner

Category Tools
Languages Node.js 18/20, Python 3.10/3.12, Java 11/17/21, Go, Ruby, Rust, .NET
Package Managers npm, yarn, pip, Maven, Gradle, NuGet, Cargo
Build Tools gcc, g++, make, cmake
Containers Docker, Docker Compose
CLIs aws, az, gcloud, kubectl, helm, terraform
Databases PostgreSQL, MySQL (installed, not running)
Browsers Chrome, Firefox (for UI testing)

The full list of installed software is published at: github.com/actions/runner-images


Choosing the Right Runner

Use Case Recommended Runner
General CI (build, test, lint) ubuntu-latest
iOS/macOS app builds macos-latest
Windows-specific builds (.NET, PowerShell) windows-latest
Cross-platform testing Matrix of all three
Cost optimization ubuntu-latest (cheapest)

Cost Comparison

Runner Minute Multiplier
ubuntu-latest 1×
windows-latest 2×
macos-latest 10×

A 10-minute job costs 10 Linux minutes, 20 Windows minutes, or 100 macOS minutes.


Runner Environment Details

Every job starts with a clean VM. Here’s what’s available:


jobs:
  info:
    runs-on: ubuntu-latest
    steps:
      - name: Runner details
        run: |
          echo "OS: $RUNNER_OS"
          echo "Arch: $RUNNER_ARCH"
          echo "Name: $RUNNER_NAME"
          echo "Temp: $RUNNER_TEMP"
          echo "Workspace: $GITHUB_WORKSPACE"
          echo "Home: $HOME"

Expected output:

OS: Linux
Arch: X64
Name: GitHub Actions 42
Temp: /home/runner/work/_temp
Workspace: /home/runner/work/repo-name/repo-name
Home: /home/runner

Larger Runners (GitHub Teams/Enterprise)

GitHub offers larger runner sizes for paid plans:

Size CPUs RAM Multiplier
Standard 4 16 GB 1×
8-core 8 32 GB 2×
16-core 16 64 GB 4×
32-core 32 128 GB 8×
64-core 64 256 GB 16×

Larger runners are configured in your organization settings, not in the YAML file.


Quick Reference

Property Value
Default runner ubuntu-latest
Fresh VM per job Yes — no state between jobs
Pre-installed tools Node, Python, Java, Docker, cloud CLIs
Disk space ~14 GB SSD
Job timeout 6 hours max
Cheapest option Linux (1× multiplier)

← Previous: Defining Jobs

Next: Job Dependencies →

Updated: