name: Test

on:
  pull_request:
    branches: [master]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Cache node modules
        id: cache
        uses: actions/cache@v2
        with:
          path: node_modules
          key: cache-node-modules-${{ hashFiles('package-lock.json') }}
      - name: npm install
        if: steps.cache.outputs.cache-hit != 'true'
        run: npm ci
      - run: npm run lint
      - run: npm run test
      - run: npm run build
