name: PR Quality Gate (Mobile)

on:
  pull_request:
    paths:
      - "js/mobile/**"
    branches: [ main ]
    types: [ opened, synchronize, reopened ]

jobs:
  verify:
    name: Lint & format check (mobile)
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: js/mobile

    steps:
      - name: Check out repository code
        uses: actions/checkout@v4

      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Enable Corepack
        run: corepack enable

      - name: Install dependencies
        run: yarn install --immutable
        
      - name: Run Code Linter
        run: yarn lint

      - name: Run Format Check
        run: yarn format:check
