name: GitHub App Tests

on:
  pull_request:
    paths:
      - "packages/github-app/**"
  push:
    branches: [main, main-teammate]
    paths:
      - "packages/github-app/**"

jobs:
  test:
    runs-on: ubuntu-latest
    concurrency:
      group: github-app-tests-${{ github.head_ref || github.run_id }}
      cancel-in-progress: true
    permissions:
      contents: read
    defaults:
      run:
        working-directory: packages/github-app
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Set up Python 3.12
        uses: actions/setup-python@v5
        with:
          python-version: "3.12"

      - name: Install uv
        uses: astral-sh/setup-uv@v6

      - name: Install dependencies
        run: uv sync --dev

      - name: Run tests
        run: uv run pytest -v
