Analyze formatting in PR 609 #1656
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow uses actions that are not certified by GitHub. | |
| # They are provided by a third-party and are governed by | |
| # separate terms of service, privacy policy, and support | |
| # documentation. | |
| name: Flutter Analyze | |
| run-name: Analyze formatting in PR ${{ github.event.number }} | |
| on: | |
| pull_request: | |
| branches: [ "develop" ] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check-format: | |
| if: github.event.pull_request.head.repo.fork == false | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 | |
| with: | |
| submodules: recursive | |
| # Note: This workflow uses the latest stable version of the Dart SDK. | |
| # You can specify other versions if desired, see documentation here: | |
| # https://github.com/dart-lang/setup-dart/blob/main/README.md | |
| # - uses: dart-lang/setup-dart@v1 | |
| - uses: subosito/flutter-action@fd55f4c5af5b953cc57a2be44cb082c8f6635e8e | |
| with: | |
| flutter-version: '3.29.2' | |
| channel: 'stable' | |
| cache: true | |
| - name: get firebase config | |
| env: | |
| CONFIG: ${{ vars.CLEAN_FIREBASE_CONFIG }} | |
| run: printf '%s' "$CONFIG" > ./lib/firebase_options.dart | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Verify formatting | |
| id: verifying | |
| continue-on-error: true | |
| run: | | |
| cp -r lib/ lib_original/ | |
| dart format --set-exit-if-changed ./lib/ | |
| - name: display diff | |
| if: steps.verifying.outcome == 'failure' | |
| continue-on-error: true | |
| run: | | |
| diff -u lib_original/ lib/ | |
| rm -rf lib_original/ | |
| # Consider passing '--fatal-infos' for slightly stricter analysis. | |
| - name: Analyze project source | |
| run: flutter analyze lib | |
| - name: fail | |
| if: steps.verifying.outcome == 'failure' | |
| run: exit 1 |