-
Notifications
You must be signed in to change notification settings - Fork 6
60 lines (49 loc) · 1.57 KB
/
dart.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
name: Dart
on:
pull_request:
paths:
- 'clients/sail_ui/**'
- 'clients/sidesail/**'
- 'clients/bitwindow/**'
- 'clients/faucet/**'
- 'clients/launcher/**'
- '.github/workflows/**'
jobs:
format-lint-test:
runs-on: ubuntu-latest
strategy:
matrix:
package: [sail_ui, sidesail, bitwindow, faucet, launcher]
defaults:
run:
working-directory: clients/${{ matrix.package }}
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
- uses: dart-lang/setup-dart@v1
- name: Install dependencies for ${{ matrix.package }}
run: flutter pub get
- name: Create necessary directories
if: matrix.package == 'sidesail'
run: |
mkdir -p bins
mkdir -p assets/bin
- name: Verify formatting for ${{ matrix.package }}
run: find . -name "*.dart" -not -path "./lib/gen/*" | xargs dart format -l 120
- name: Analyze project source for ${{ matrix.package }}
run: dart analyze
- name: Look for fixable lint issues for ${{ matrix.package }}
run: |
FIXES=$(dart fix --dry-run)
if [[ "$FIXES" != *"Nothing to fix!"* ]]; then
echo "Fixable issues found. Run 'dart fix --apply' locally and commit changes."
echo "$FIXES"
exit 1
fi
- name: Run tests for ${{ matrix.package }}
run: |
if [ -d "test" ]; then
flutter test
else
echo "Test directory not found. Skipping tests."
fi