Skip to content

Commit 8e410a6

Browse files
authored
Update flutter.yml
1 parent 96a01ea commit 8e410a6

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

.github/workflows/flutter.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# This workflow uses actions that are not certified by GitHub.
2-
# They are provided by a third-party and are governed by
3-
# separate terms of service, privacy policy, and support
4-
# documentation.
5-
61
name: Flutter
72

83
on:
@@ -16,19 +11,37 @@ jobs:
1611
runs-on: ubuntu-latest
1712

1813
steps:
14+
# 1. Checkout source code
1915
- uses: actions/checkout@v4
20-
21-
- uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603
22-
16+
17+
# 2. Setup Flutter SDK
18+
- uses: subosito/flutter-action@v2
19+
with:
20+
flutter-version: 'stable' # Bisa diganti ke '3.19.0' misalnya
21+
22+
# 3. Cache Flutter dependencies
23+
- name: Cache Flutter dependencies
24+
uses: actions/cache@v3
25+
with:
26+
path: |
27+
~/.pub-cache
28+
.dart_tool
29+
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.yaml') }}
30+
restore-keys: |
31+
${{ runner.os }}-flutter-
32+
33+
# 4. Install dependencies
2334
- name: Install dependencies
2435
run: flutter pub get
25-
36+
37+
# 5. Run analysis
2638
- name: Analyze project source
2739
run: flutter analyze
28-
40+
41+
# 6. Run unit tests
2942
- name: Run tests
3043
run: flutter test
31-
32-
- name: Check Flutter
44+
45+
# 7. Show Flutter environment info (useful for debugging)
46+
- name: Flutter doctor
3347
run: flutter doctor -v
34-

0 commit comments

Comments
 (0)