Skip to content
Latchkey

How to Run Lint and Tests in Parallel Jobs in GitHub Actions

Jobs without a needs dependency start at the same time on separate runners.

Define lint and test as sibling jobs with no needs between them; the runner schedules both immediately.

Steps

  • Split lint and test into two top-level jobs.
  • Do not add needs between them so they run concurrently.
  • Let a downstream job depend on both with needs: [lint, test].

Workflow

.github/workflows/ci.yml
jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm run lint
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm test

Gotchas

  • Each job runs on its own runner, so they share no filesystem.
  • Latchkey runs parallel jobs on cheaper managed runners, so fanning out costs less.

Related guides

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