Skip to content

Create node.js.yml

Create node.js.yml #3

Workflow file for this run

name: Node.js CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x, 23.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Generate package-lock.json
run: |
npm install --package-lock-only
git add package-lock.json
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
- name: Report test coverage
run: npm run coverage
if: success()