-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
66 additions
and
3 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,44 @@ | ||
name: Dart CI | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dart-lang/setup-dart@v1 | ||
- name: Install dependencies | ||
run: dart pub get | ||
|
||
- name: Verify formatting | ||
run: dart format --output=none --set-exit-if-changed . | ||
|
||
- name: Analyze project source | ||
run: dart analyze --fatal-infos | ||
|
||
- name: Analyze project source - Code Metrics | ||
run: | | ||
result=$(dart run dart_code_metrics:metrics analyze lib --fatal-style --fatal-performance --fatal-warnings) | ||
echo "$result" | ||
[[ $result == '✔ no issues found!' ]] || { echo -e "${RED}Linter error" ; exit 1; } | ||
- name: Analyze project source - Check Unused Code | ||
run: dart run dart_code_metrics:metrics check-unused-code lib --fatal-unused | ||
|
||
- name: Analyze project source - Check Unused Files | ||
run: dart run dart_code_metrics:metrics check-unused-files lib --fatal-unused | ||
|
||
- name: Run tests | ||
run: | | ||
dart pub global activate coverage 1.2.0 | ||
dart test --coverage=coverage && dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --packages=.packages --report-on=lib | ||
- uses: codecov/codecov-action@v3 | ||
with: | ||
verbose: true | ||
files: ./coverage/lcov.info |
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,16 @@ | ||
name: Dart Code Metrics | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
check: | ||
name: dart-code-metrics-action | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: dart-code-metrics | ||
uses: dart-code-checker/dart-code-metrics-action@v2 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
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