name: PR Layered Tests

on:
  pull_request:
    branches: [main]
  workflow_dispatch:

permissions:
  contents: read

concurrency:
  group: pr-tests-${{ github.ref }}
  cancel-in-progress: true

env:
  FLUTTER_VERSION: 3.41.4

jobs:
  flutter-pr-layer:
    runs-on: ubuntu-22.04
    steps:
      - name: Checkout
        uses: actions/checkout@v7

      - name: Setup Flutter
        uses: ./.github/actions/setup-flutter-sdk
        with:
          flutter-version: ${{ env.FLUTTER_VERSION }}

      - name: Install Linux deps
        run: bash ./scripts/ci/setup_platform_deps.sh linux

      - name: Run Flutter PR layered tests
        run: bash ./scripts/ci/run_layered_tests.sh pr
