A GitHub Actions CI workflow builder for Node.js that generates a valid
.github/workflows/ci.yml. Pick the Node versions to test, your package manager, and which
jobs to run, and it produces a workflow with a version matrix, dependency caching, and
lint, test, and build steps.
How it works
The workflow triggers on push and pull_request to the branch you choose. It defines a
single build job on ubuntu-latest with a strategy.matrix.node-version listing your
versions, so the job runs once per version in parallel. fail-fast: false keeps the other
versions running even if one fails, so you see every failure at once.
Each run checks out the code, sets up Node with actions/setup-node@v4 (which keys the
dependency cache off your lockfile via cache: npm|yarn|pnpm), installs with the
reproducible command for your package manager (npm ci, yarn install --frozen-lockfile,
or pnpm install --frozen-lockfile), then runs the lint, test, and build scripts you
enabled. For pnpm it also adds the pnpm/action-setup step that the cache wiring requires.
Tips and notes
- The script names (
lint,test,build) must exist in yourpackage.json. Untick any step whose script you do not have, or the job will fail on a missing script. - The matrix is cheap — testing on the oldest and newest Node versions you support (for example 18 and 22) catches most compatibility issues without burning extra minutes.
- For pnpm, the workflow pins
pnpm/action-setup@v4with a version; bump it to match thepackageManagerfield in yourpackage.jsonif you have one. - To publish or deploy on success, add a second job with
needs: buildso it only runs after the matrix passes.