TestDrive: Run Your CI Steps Locally — Fast

Over the past year, I bounced across repos with different test and lint setups. I'd push a branch, CI would grind for minutes, and then a job like yarn lint would fail because I forgot to run it locally.

TestDrive running locally

Then it clicked: GitHub Actions already describes exactly what will run via YAML. If CI knows the steps, I can read the YAML and run those steps locally.

That's what TestDrive does.

What Is TestDrive?

TestDrive reads your GitHub Actions workflow files and runs the steps locally. The output looks just like GitHub's CI — you see the yellow circles (running), green checkmarks (success), and red X's (failure) that you're used to seeing in the Actions tab.

Instead of pushing and waiting 2–10 minutes for CI, you get results in 3–30 seconds on your machine.

How It Works

The tool reads your .github/workflows/*.yml files and executes the run: commands locally. It respects environment variables, working directories, and your shell setup.

When you run it, you see a live streaming UI that shows jobs as they execute — just like watching a GitHub Actions run. Each job line updates in real-time from pending to running to completed.

Failed jobs expand automatically to show which step failed and why, with trimmed output that gets straight to the point.

Key Features

  • Live GitHub-style UI (yellow circles → green checks → red X's)
  • Filters specific jobs and steps
  • JSON output for automation
  • Dry-run mode to preview commands
  • Version checks against .ruby-version / .node-version
  • Safety guardrails for privileged commands

Install & Use

go install github.com/bgricker/testdrive/cmd/testdrive@latest
testdrive run

That's it. TestDrive reads your workflow files and runs the steps. You can filter to specific jobs, preview commands with --dry-run, or get JSON output for automation.

Example Output

✅ lint (3.2s)
✅ scan_js (1.9s)
❌ test (31.4s)
    ⏭️ Install packages (0s)
    ✅ Install modules (247ms)
    ❌ Run tests (31.1s)
      Command: bin/rails db:setup spec
      spec/jobs/foo_spec.rb:123 expected X got Y
SUMMARY: 2 passed, 1 failed, 1 skipped (36.7s)

The yellow circles turn green on success or red on failure. Just like GitHub Actions. Failed jobs expand to show the exact error.

The Catch

It runs on your machine, not in a container. That means it uses your local toolchain and environment. For workflows that need specific services or matrix builds, you'll still want to push to CI.

But for the 95% case where your dev environment is close enough to CI, it's fast: 5–30 seconds locally vs 5–10 minutes waiting for GitHub.

  • Repo: github.com/bgricker/testdrive
  • Install: go install github.com/bgricker/testdrive/cmd/testdrive@latest
  • Try: testdrive listtestdrive run --dry-run