name: Tests
on:
  workflow_dispatch:
  pull_request:
jobs:
  test:
    name: Analyze, test, and enforce coverage
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
      - name: Setup Flutter
        uses: subosito/flutter-action@v2
        with:
          channel: "stable"
      - name: Install dependencies
        run: flutter pub get
      - name: Analyze
        run: flutter analyze
      - name: Run tests with coverage
        run: flutter test --coverage
      - name: Enforce 100% package line coverage
        run: bash tool/check_coverage.sh
