name: Run Tests

on:
  pull_request:
    paths:
      - "packges/**"
    branches:
      - main
      - canary

jobs:
  test:
    name: Run tests/lint/type-check on pull request
    runs-on: ubuntu-latest

    steps:
      - name: Checkout Repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

      - name: Setup PNPM
        uses: pnpm/action-setup@v2
        with:
          version: 6.10.0

      - name: Setup Node
        uses: actions/setup-node@v2
        with:
          node-version: "16"
          cache: "pnpm"

      - name: Install dependencies
        run: pnpm install

      - name: Run test/lint/type-check and build
        run: |
          pnpm check
          pnpm build
