GitHub Actions Workflow for Lint and Type-Check in Parallel
Run lint and type-check side by side, not back to back.
This workflow splits lint and type-check into independent jobs that run concurrently, shortening the critical path.
The workflow
.github/workflows/ci.yml
name: CI
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20, cache: npm }
- run: npm ci
- run: npm run lint
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20, cache: npm }
- run: npm ci
- run: npm run type-checkNotes
- Independent jobs run in parallel by default.
- Each installs deps, so caching keeps the overhead small.
- Add a
testjob alongside for a three-way fan-out.
Run it cheaper
Point runs-on: at a Latchkey label to run this workflow at roughly 69% lower per-minute cost, with self-healing for transient failures.
Related guides
How to Speed Up GitHub Actions: 9 High-Impact TacticsMake GitHub Actions faster: caching, parallelization, test splitting, Docker layer caching, slimmer images, a…
GitHub Actions Workflow Template for Node.jsA ready-to-use GitHub Actions workflow for Node.js with caching and best practices - copy, commit, and run fa…