1
1
name : stream_flutter_workflow
2
2
3
3
env :
4
- ACTIONS_ALLOW_UNSECURE_COMMANDS : ' true'
4
+ # Note: The versions below should be manually updated after a new major
5
+ # version comes out.
5
6
flutter_version : " 3.x"
6
7
7
8
on :
8
9
pull_request :
9
- paths :
10
- - ' packages/**'
11
- - ' .github/workflows/stream_flutter_workflow.yml'
12
10
types :
13
11
- opened
14
12
- reopened
@@ -23,127 +21,102 @@ concurrency:
23
21
cancel-in-progress : true
24
22
25
23
jobs :
26
- analyze :
27
- timeout-minutes : 15
28
- if : github.event.pull_request.draft == false
29
- runs-on : ubuntu-latest
30
- steps :
31
- - name : " Git Checkout"
32
- uses : actions/checkout@v4
33
- with :
34
- fetch-depth : 0
35
- - name : " Install Flutter"
36
- uses : subosito/flutter-action@v2
37
- with :
38
- flutter-version : ${{ env.flutter_version }}
39
- channel : stable
40
- cache : true
41
- cache-key : flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
42
- - name : " Install Tools"
43
- run : |
44
- flutter pub global activate melos
45
- - name : " Bootstrap Workspace"
46
- run : melos bootstrap --verbose
47
- - name : " Dart Analyze"
48
- run : |
49
- melos run analyze
50
- - name : " Pub Check"
51
- if : github.base_ref == 'master'
52
- run : |
53
- melos run lint:pub
54
-
55
- format :
24
+ lint :
56
25
runs-on : ubuntu-latest
57
- if : github.event.pull_request.draft == false
58
26
timeout-minutes : 15
59
27
steps :
60
- - name : " Git Checkout"
28
+ - name : 📚 Git Checkout
61
29
uses : actions/checkout@v4
62
30
with :
63
31
fetch-depth : 0
64
- - name : " Install Flutter"
32
+
33
+ - name : 🎯 Setup Flutter
65
34
uses : subosito/flutter-action@v2
66
35
with :
67
- flutter-version : ${{ env.flutter_version }}
68
- channel : stable
69
36
cache : true
37
+ channel : stable
38
+ flutter-version : ${{ env.flutter_version }}
70
39
cache-key : flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
71
- - name : " Install Tools"
72
- run : |
73
- flutter pub global activate melos
74
- - name : " Bootstrap Workspace"
40
+
41
+ - name : 📦 Install Tools
42
+ run : flutter pub global activate melos
43
+
44
+ - name : ⚙️ Bootstrap Workspace
75
45
run : melos bootstrap
76
- - name : " Melos Format"
77
- run : melos run format
78
- - name : " Validate Formatting"
79
- run : |
80
- ./.github/workflows/scripts/validate-formatting.sh
46
+
47
+ - name : ✨ Check Formatting
48
+ run : melos run format:changes
49
+
50
+ - name : 🕵️ Analyze
51
+ run : melos run analyze:changes
52
+
53
+ - if : github.base_ref == 'master'
54
+ name : 🚀 Pub Check
55
+ run : melos run publish:dry-run:changes
81
56
82
57
test :
83
58
runs-on : ubuntu-latest
84
- if : github.event.pull_request.draft == false
85
59
timeout-minutes : 30
86
60
steps :
87
- - name : " Git Checkout"
61
+ - name : 📚 Git Checkout
88
62
uses : actions/checkout@v4
89
63
with :
90
64
fetch-depth : 0
91
- - name : " Install Flutter"
65
+
66
+ - name : 🎯 Setup Flutter
92
67
uses : subosito/flutter-action@v2
93
68
with :
94
- flutter-version : ${{ env.flutter_version }}
95
- channel : stable
96
69
cache : true
70
+ channel : stable
71
+ flutter-version : ${{ env.flutter_version }}
97
72
cache-key : flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
98
- # This step is needed due to https://github.com/actions/runner-images/issues/11279
99
- - name : Install SQLite3
100
- run : sudo apt-get update && sudo apt-get install -y sqlite3 libsqlite3-dev
101
- - name : " Install Tools"
73
+
74
+ - name : 📦 Install Tools
102
75
run : |
103
76
flutter pub global activate melos
104
77
flutter pub global activate remove_from_coverage
105
- - name : " Bootstrap Workspace"
78
+
79
+ - name : ⚙️ Bootstrap Workspace
106
80
run : melos bootstrap
107
- - name : " Flutter Test"
108
- run : melos run test:all
109
- - name : " Collect Coverage"
81
+
82
+ - name : 🧪 Run Tests
83
+ run : melos run test:packages:changed
84
+
85
+ - name : 📊 Collect Coverage
110
86
run : melos run coverage:ignore-file --no-select
111
- - name : " Upload Coverage"
112
- uses : codecov/codecov-action@v5
113
- with :
114
- token : ${{secrets.CODECOV_TOKEN}}
115
- files : packages/*/coverage/lcov.info
116
- - name : " Stream Chat Coverage Check"
87
+
88
+ - name : ✅ Stream Chat Coverage Check
117
89
uses :
VeryGoodOpenSource/[email protected]
118
90
with :
119
91
path : packages/stream_chat/coverage/lcov.info
120
92
min_coverage : 70
121
- - name : " Stream Chat Localizations Coverage Check"
93
+
94
+ - name : ✅ Stream Chat Localizations Coverage Check
122
95
uses :
VeryGoodOpenSource/[email protected]
123
96
with :
124
97
path : packages/stream_chat_localizations/coverage/lcov.info
125
98
min_coverage : 100
126
- - name : " Stream Chat Persistence Coverage Check"
99
+
100
+ - name : ✅ Stream Chat Persistence Coverage Check
127
101
uses :
VeryGoodOpenSource/[email protected]
128
102
with :
129
103
path : packages/stream_chat_persistence/coverage/lcov.info
130
104
min_coverage : 95
131
- - name : " Stream Chat Flutter Core Coverage Check"
105
+
106
+ - name : ✅ Stream Chat Flutter Core Coverage Check
132
107
uses :
VeryGoodOpenSource/[email protected]
133
108
with :
134
109
path : packages/stream_chat_flutter_core/coverage/lcov.info
135
110
min_coverage : 30
136
- - name : " Stream Chat Flutter Coverage Check"
111
+
112
+ - name : ✅ Stream Chat Flutter Coverage Check
137
113
uses :
VeryGoodOpenSource/[email protected]
138
114
with :
139
115
path : packages/stream_chat_flutter/coverage/lcov.info
140
116
min_coverage : 44
141
117
142
- draft-build :
143
- runs-on : ubuntu-latest
144
- if : github.event.pull_request.draft == true
145
- timeout-minutes : 1
146
-
147
- steps :
148
- - name : Run a one-line script
149
- run : echo Draft PR, you are good.
118
+ - name : 📁 Upload coverage to Codecov
119
+ uses : codecov/codecov-action@v5
120
+ with :
121
+ token : ${{secrets.CODECOV_TOKEN}}
122
+ files : packages/*/coverage/lcov.info
0 commit comments