name: CI

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      # - uses: actions/setup-java@v1
      #   with:
      #     java-version: "12.x"

      - uses: subosito/flutter-action@v1
        with:
          flutter-version: "3.3.x"

      - name: Install dependencies
        run: flutter pub get

      - name: Verify formatting
        run: flutter format --set-exit-if-changed .

      # Consider passing '--fatal-infos' for slightly stricter analysis.
      # - name: Analyze project source
      #   run: flutter analyze

      - name: Run tests
        run: flutter test
