name: Flutter analyze & test

on:
  workflow_dispatch: {}
  push:
    branches:
      - dev
    paths:
      - lib/**/*.dart

jobs:
  flutter_analyze_and_test:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - name: Clone repository
        uses: actions/checkout@v4

      - name: Set up Flutter
        uses: subosito/flutter-action@v2
        with:
          channel: stable

      - name: Cloning sub-repos
        run: git submodule update --init --recursive

      - name: flutter pub get
        run:  flutter pub get

      - name: flutter analyze
        run:  flutter analyze

      # - name: flutter test
      #   run:  flutter test
