-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (78 loc) · 2.3 KB
/
code_quality_checks.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Code Quality Checks
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
flutter_version: ${{ vars.FLUTTER_VERSION }}
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.flutter_version }}
channel: 'stable'
cache: true
- name: Run setup script
run: bash setup.ps1
- name: Verify formatting
run: |
dart format . --fix
git diff --exit-code
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.flutter_version }}
channel: 'stable'
cache: true
- name: Run setup script
run: bash setup.ps1
- name: Analyze project source
run: |
flutter analyze --suggestions
dart run dart_code_metrics:metrics analyze lib test --reporter=github
dart run dart_code_metrics:metrics check-unused-files lib
dart run dart_code_metrics:metrics check-unused-code lib
spell-checking:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.flutter_version }}
channel: 'stable'
cache: true
- name: Run setup script
run: bash setup.ps1
- name: Check spelling
uses: crate-ci/[email protected]
with:
config: .github/typos.toml
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.flutter_version }}
channel: 'stable'
cache: true
- name: Run setup script
run: bash setup.ps1
- name: Run tests
run: |
flutter test --coverage --branch-coverage --reporter=github --test-randomize-ordering-seed random
dart run test_cov_console -e lib/l10n/locale_keys.g.dart
- name: Upload code coverage
uses: codecov/codecov-action@v4
with:
directory: coverage
fail_ci_if_error: true
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}