45 lines
845 B
YAML
45 lines
845 B
YAML
name: Build and Test
|
|
|
|
on:
|
|
push:
|
|
branches: [ master, main, develop ]
|
|
pull_request:
|
|
branches: [ master, main, develop ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [16.x, 18.x, 20.x]
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Run linter
|
|
run: npm run lint
|
|
|
|
- name: Run tests
|
|
run: npm test
|
|
|
|
- name: Build package
|
|
run: npm run build
|
|
|
|
- name: Upload coverage
|
|
uses: actions/upload-artifact@v3
|
|
if: matrix.node-version == '20.x'
|
|
with:
|
|
name: coverage
|
|
path: coverage/
|