name: test

on:
  workflow_dispatch:
  pull_request:

jobs:
  test-components:
    runs-on: ubuntu-latest
    env:
      NODE_OPTIONS: --max_old_space_size=4096
    steps:
      - name: Checkout repo
        uses: actions/checkout@v2
      - name: Set up node
        uses: actions/setup-node@v2
        with:
          node-version: 'lts/*'
          cache: 'yarn'
      - name: Install dependencies
        run: yarn install --immutable
      - name: Run lint
        run: yarn lint
      - name: Build Components
        run: yarn build
      - name: Run tests
        run: yarn test
