-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set up Github actions to detect syntax and formatting errors. (#66)
* Set up Github actions to detect syntax and formatting errors. * Updated flutter version. * Changed line lenght from 100 to 80. * Add formated files. * Fix line length in .yml file. --------- Co-authored-by: Aku <[email protected]>
- Loading branch information
1 parent
23cc984
commit b82ad5f
Showing
5 changed files
with
63 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Deploy application | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
render_document: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Git repository | ||
uses: actions/checkout@v3 | ||
- name: Set up flutter-action | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: '3.13.0' | ||
channel: 'stable' | ||
- name: Get dependencies | ||
run: flutter pub get | ||
- name: Detect formatting errors | ||
run: dart format --line-length 80 --set-exit-if-changed --output none . | ||
- name: Detect syntax errors | ||
run: flutter analyze --no-pub . |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Max line length for Dart files. | ||
LINE_LENGTH=80 | ||
|
||
echo | ||
echo "Running Dart Format, please wait…" | ||
echo | ||
|
||
if ! dart --disable-analytics format --fix --line-length $LINE_LENGTH "."; then | ||
echo | ||
echo "Fatal: Dart Format exited with an error. Please fix the issues and commit again." | ||
echo | ||
exit 1 | ||
fi | ||
|
||
echo | ||
echo "Running Dart Analysis, please wait…" | ||
echo | ||
|
||
# Run Dart Analysis on all modules. | ||
if ! flutter --suppress-analytics analyze --no-pub "."; then | ||
echo | ||
echo "Dart Analysis found some issues. Please fix the issues and commit again." | ||
echo | ||
exit 1 | ||
fi | ||
|
||
echo | ||
echo "Dart Analysis found no issues, congratulations! Continuing with commit…" | ||
echo |