name: PR Status Checks

on:
  # Allows it to be manually triggered, used primarily for debugging 
  workflow_dispatch:
  pull_request:
    branches:
      - develop

jobs:
  checks:
    name: "Checks"
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Setup Nodejs and yarn
        uses: actions/setup-node@v2
        with:
          node-version: "16"
          cache: yarn

      - name: Install dependencies
        run: yarn
        
      - name: Check that it builds
        run: yarn build

      - name: Check formatting and types
        run: yarn type-check

      - name: Check that versions of the package dependencies match those in yarn’s lock file
        run: yarn file-check
