name: Validate
on:
  push:
  pull_request:

permissions:
  contents: read # to fetch code (actions/checkout)

jobs:
  validate:
    name: Validate
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2.3.3
      - uses: actions/setup-node@v2.1.2
        with:
          node-version: '14'
      - name: Restore npm cache
        uses: actions/cache@v2
        with:
          path: ~/.npm
          key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
          restore-keys: |
            ${{ runner.os }}-node-
      - name: Install dependencies
        run: npm install
      - name: Validate
        run: npm run validate