-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/design-text-field
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 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,55 @@ | ||
name: Library ON Push & PR DO Code check | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- "main" | ||
|
||
jobs: | ||
code-check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: "stable" | ||
|
||
- name: Check Flutter SDK version | ||
run: flutter --version | ||
|
||
- name: Get dependencies | ||
run: flutter pub get | ||
|
||
- name: Setup Dart Code Metrics | ||
run: dart pub get dart_code_metrics | ||
|
||
- name: Run Dart Code Metrics | ||
run: | | ||
dirs_to_analyze="" | ||
if [ -d lib ]; then dirs_to_analyze+=" lib"; fi | ||
if [ -d test ]; then dirs_to_analyze+=" test"; fi | ||
if [ -d example ]; then dirs_to_analyze+=" example"; fi | ||
if [ dirs_to_analyze != "" ] | ||
then | ||
dart run dart_code_metrics:metrics \ | ||
analyze \ | ||
$dirs_to_analyze \ | ||
--fatal-warnings \ | ||
--fatal-performance \ | ||
--fatal-style | ||
fi | ||
- name: Check formatting | ||
run: dart format . --set-exit-if-changed | ||
|
||
- name: Run tests | ||
run: | | ||
# run tests if `test` folder exists | ||
if [ -d test ] | ||
then | ||
flutter test -r expanded | ||
else | ||
echo "Tests not found." | ||
fi |