Skip to content
Latchkey

How to Control fail-fast in a GitHub Actions Matrix

fail-fast is true by default, so one failing leg cancels its siblings; set it false to see every result.

Set strategy.fail-fast: false to let all legs finish even after one fails, or keep the default true to cancel siblings early and save minutes.

Steps

  • Add fail-fast: under strategy.
  • Use true (default) for fast PR feedback that stops at the first break.
  • Use false when you need the full pass/fail picture across all legs.

Workflow

.github/workflows/ci.yml
jobs:
  test:
    strategy:
      fail-fast: false
      matrix:
        node: [18, 20, 22]
    runs-on: ubuntu-latest
    steps:
      - run: npm ci && npm test

Gotchas

  • With fail-fast on, a single failure cancels in-flight siblings, so you lose their results.
  • fail-fast and continue-on-error are independent controls; you can combine them per leg.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →