Skip to content

CI — Node.js

Runs lint → typecheck → test → build for a Node.js application. Auto-detects pnpm or bun from the lockfile.

Usage

yaml
jobs:
  ci:
    uses: KevinDeBenedetti/github-workflows/.github/workflows/ci-node.yml@main
    with:
      node-version: '20'
      working-directory: '.'

Inputs

InputTypeDefaultDescription
node-versionstring'20'Node.js version
working-directorystring'.'Path to the app root (e.g. apps/web)
package-managerstringautopnpm | bun | auto — auto-detects from lockfile
frameworkstringautonext | nuxt | vite | auto — resolves build output path when uploading
run-lintbooleantrueRun lint script
run-typecheckbooleantrueRun typecheck script
run-testbooleantrueRun test script
run-buildbooleantrueRun build script
upload-buildbooleanfalseUpload build output as a workflow artifact
build-artifact-namestringbuildName of the uploaded artifact

Steps

  1. Checkout
  2. Setup Node.js + package manager (via setup-node)
  3. Lint
  4. Typecheck
  5. Test (--passWithNoTests)
  6. Build
  7. Upload artifact (only when upload-build: true)

Notes

  • Build output path is resolved per framework: next.next, nuxt.output, otherwise dist.
  • Setting framework: auto (default) detects the framework from config files (next.config.*, nuxt.config.*).
  • Steps are individually skippable with their run-* flags, which is useful for partial pipelines (e.g. build-only).