Skip to content

Commit 8beccbe

Browse files
committed
2 parents 72a198f + 8e410a6 commit 8beccbe

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/flutter.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Flutter
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
# 1. Checkout source code
15+
- uses: actions/checkout@v4
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
34+
- name: Install dependencies
35+
run: flutter pub get
36+
37+
# 5. Run analysis
38+
- name: Analyze project source
39+
run: flutter analyze
40+
41+
# 6. Run unit tests
42+
- name: Run tests
43+
run: flutter test
44+
45+
# 7. Show Flutter environment info (useful for debugging)
46+
- name: Flutter doctor
47+
run: flutter doctor -v

0 commit comments

Comments
 (0)