46 lines
867 B
YAML
46 lines
867 B
YAML
|
name: CI
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
branches: [main, master]
|
||
|
pull_request:
|
||
|
branches: [main, master]
|
||
|
|
||
|
jobs:
|
||
|
build:
|
||
|
runs-on: ubuntu-latest
|
||
|
|
||
|
strategy:
|
||
|
matrix:
|
||
|
node-version: [16.x, 18.x, 20.x]
|
||
|
|
||
|
steps:
|
||
|
- uses: actions/checkout@v3
|
||
|
|
||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||
|
uses: actions/setup-node@v3
|
||
|
with:
|
||
|
node-version: ${{ matrix.node-version }}
|
||
|
|
||
|
- name: Install dependencies
|
||
|
run: npm ci
|
||
|
|
||
|
- name: Lint
|
||
|
run: npm run lint
|
||
|
|
||
|
- name: Build
|
||
|
run: npm run build
|
||
|
|
||
|
- name: Run tests
|
||
|
run: npm test
|
||
|
|
||
|
- name: Generate coverage
|
||
|
run: npm run test:coverage
|
||
|
|
||
|
- name: Archive coverage
|
||
|
uses: actions/upload-artifact@v3
|
||
|
with:
|
||
|
name: coverage-${{ matrix.node-version }}
|
||
|
path: coverage
|
||
|
retention-days: 5
|