name: Test

on:
  push:
  pull_request:

jobs:
  test:
    name: Build and Test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout project
        uses: actions/checkout@v3

      - name: Install latest Node.JS
        uses: actions/setup-node@v3
        with:
          node-version: latest

      - name: Install dependencies
        run: npm install
        
      - name: Build package
        run: npm run build

      - name: Lint packages
        run: npm run lint

      - name: Test packages
        run: npm run test