11name : stream_flutter_workflow
22
33env :
4- ACTIONS_ALLOW_UNSECURE_COMMANDS : ' true'
4+ # Note: The versions below should be manually updated after a new major
5+ # version comes out.
56 flutter_version : " 3.x"
67
78on :
89 pull_request :
9- paths :
10- - ' packages/**'
11- - ' .github/workflows/stream_flutter_workflow.yml'
1210 types :
1311 - opened
1412 - reopened
@@ -23,127 +21,102 @@ concurrency:
2321 cancel-in-progress : true
2422
2523jobs :
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 :
5625 runs-on : ubuntu-latest
57- if : github.event.pull_request.draft == false
5826 timeout-minutes : 15
5927 steps :
60- - name : " Git Checkout"
28+ - name : 📚 Git Checkout
6129 uses : actions/checkout@v4
6230 with :
6331 fetch-depth : 0
64- - name : " Install Flutter"
32+
33+ - name : 🎯 Setup Flutter
6534 uses : subosito/flutter-action@v2
6635 with :
67- flutter-version : ${{ env.flutter_version }}
68- channel : stable
6936 cache : true
37+ channel : stable
38+ flutter-version : ${{ env.flutter_version }}
7039 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
7545 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
8156
8257 test :
8358 runs-on : ubuntu-latest
84- if : github.event.pull_request.draft == false
8559 timeout-minutes : 30
8660 steps :
87- - name : " Git Checkout"
61+ - name : 📚 Git Checkout
8862 uses : actions/checkout@v4
8963 with :
9064 fetch-depth : 0
91- - name : " Install Flutter"
65+
66+ - name : 🎯 Setup Flutter
9267 uses : subosito/flutter-action@v2
9368 with :
94- flutter-version : ${{ env.flutter_version }}
95- channel : stable
9669 cache : true
70+ channel : stable
71+ flutter-version : ${{ env.flutter_version }}
9772 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
10275 run : |
10376 flutter pub global activate melos
10477 flutter pub global activate remove_from_coverage
105- - name : " Bootstrap Workspace"
78+
79+ - name : ⚙️ Bootstrap Workspace
10680 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
11086 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
11789 uses :
VeryGoodOpenSource/[email protected] 11890 with :
11991 path : packages/stream_chat/coverage/lcov.info
12092 min_coverage : 70
121- - name : " Stream Chat Localizations Coverage Check"
93+
94+ - name : ✅ Stream Chat Localizations Coverage Check
12295 uses :
VeryGoodOpenSource/[email protected] 12396 with :
12497 path : packages/stream_chat_localizations/coverage/lcov.info
12598 min_coverage : 100
126- - name : " Stream Chat Persistence Coverage Check"
99+
100+ - name : ✅ Stream Chat Persistence Coverage Check
127101 uses :
VeryGoodOpenSource/[email protected] 128102 with :
129103 path : packages/stream_chat_persistence/coverage/lcov.info
130104 min_coverage : 95
131- - name : " Stream Chat Flutter Core Coverage Check"
105+
106+ - name : ✅ Stream Chat Flutter Core Coverage Check
132107 uses :
VeryGoodOpenSource/[email protected] 133108 with :
134109 path : packages/stream_chat_flutter_core/coverage/lcov.info
135110 min_coverage : 30
136- - name : " Stream Chat Flutter Coverage Check"
111+
112+ - name : ✅ Stream Chat Flutter Coverage Check
137113 uses :
VeryGoodOpenSource/[email protected] 138114 with :
139115 path : packages/stream_chat_flutter/coverage/lcov.info
140116 min_coverage : 44
141117
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