name: CI

on:
  pull_request:
    branches:
      - "**"
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: 14
      - name: npm install, build, and test
        run: |
          npm install
          npm run build --if-present
          npm test
        env:
          CI: true
