name: PR Source Code Check

on:
  - push

jobs:
  lint:
    name: Run ESLint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '14'
          cache: 'yarn'
      - run: yarn
      - run: yarn lint:strict

  tsc:
    name: Run Type Check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '14'
          cache: 'yarn'
      - run: yarn
      - run: yarn typecheck

  prettier:
    name: Run Prettier Check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '14'
          cache: 'yarn'
      - run: yarn
      - run: yarn format:check

  test:
    name: Run Test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '14'
          cache: 'yarn'
      - run: yarn
      - run: yarn test
