name: dart

on: [push, pull_request]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-java@v1
        with:
          java-version: '12.x'
      - uses: subosito/flutter-action@v1
      - name: Version
        run: flutter doctor -v
      - name: Install dependencies
        run: flutter pub get
      - name: Format
        run: flutter format -n --set-exit-if-changed .
      - name: Linter
        run: flutter analyze