Skip to content
name: Build and test
on: [pull_request]
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [14.x, 18.x]
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-${{ matrix.node-version }}-
${{ runner.os }}-npm-
- name: install
run: |
npm ci
- name: static checks
run: |
npm run lint
- name: build
run: |
npm run build
- name: test
run: |
npm run test
npm run testb