Add dart format check #6
Workflow file for this run
This file contains 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
name: check | |
on: | |
# Curently, this workflow is triggered by pull request events only. | |
# Uncomment the following line to run this workflow on push events | |
# push: | |
# branches: | |
# - main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
flutter-analyze: | |
name: flutter analyze | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.7.2' # Uses the minimum supported version. | |
channel: 'stable' | |
# Setup Melos | |
- name: Setup Melos | |
run: | | |
dart pub global activate melos | |
# Run Melos bootstrap | |
- name: Melos bootstrap | |
run: | | |
melos bootstrap | |
# Get Flutter version | |
- name: Get Flutter version | |
run: flutter --version | |
# Get dependencies | |
- name: Get dependencies | |
run: flutter pub get | |
# Run flutter analyze | |
- name: flutter analyze | |
run: flutter analyze | |
dart-format: | |
name: dart format | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.7.2' # Uses the minimum supported version. | |
channel: 'stable' | |
# Setup Melos | |
- name: Setup Melos | |
run: | | |
dart pub global activate melos | |
# Run Melos bootstrap | |
- name: Melos bootstrap | |
run: | | |
melos bootstrap | |
# CHeck if there are formatting issues | |
- name: Check formatting | |
run: | | |
dart format --set-exit-if-changed . | |
if ( $? -eq 1 ); then | |
echo "dart format has detected issues" | |
exit 1 | |
fi |