name: camera

on:
  pull_request:
    paths:
      - "packages/camera/camera/**"
      - ".github/workflows/camera.yaml"

jobs:
  build:
    defaults:
      run:
        working-directory: packages/camera/camera
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - uses: subosito/flutter-action@v1.5.0
        with:
          channel: master

      - name: Install Dependencies
        run: flutter packages get

      - name: Format
        run: dart format --set-exit-if-changed lib test

      - name: Analyze
        run: flutter analyze lib test

      - name: Run tests
        run: flutter test --no-pub --coverage --test-randomize-ordering-seed random

      - name: Check Code Coverage
        uses: VeryGoodOpenSource/very_good_coverage@v1.1.1
        with:
          path: packages/camera/camera/coverage/lcov.info
