name: Pull Request

on:
  pull_request:
    branches: [main, canary]

permissions:
  contents: read

jobs:
  pr-check:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        job: [build, test, typecheck]
    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20.16.0
          cache: "pnpm"
      - run: pnpm install --frozen-lockfile
      - run: pnpm server:build
      - run: pnpm ${{ matrix.job }}
