Skip to content

CII-Best-Practices for Nodejs: Silver level #234

CII-Best-Practices for Nodejs: Silver level

CII-Best-Practices for Nodejs: Silver level #234

Workflow file for this run

name: Node.js CI
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
test:
name: Test on Node.js ${{ matrix.node-version }} and ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [14.x, 16.x, 18.x, 19.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@03bee3930647ebbf994244c21ddbc0d4933aab4f # v2.3.0
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Run tests
run: |
npm test