-
Notifications
You must be signed in to change notification settings - Fork 1.7k
295 lines (272 loc) · 9.9 KB
/
analyze_test_build.yml
File metadata and controls
295 lines (272 loc) · 9.9 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
name: Static Analysis, Run Tests and Build Web Apps
on:
pull_request:
push:
branches:
- main
jobs:
bloc_flutter:
name: bloc_flutter
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis, Run Tests, and Build web app
uses: ./.github/actions/flutter_analysis_test_build
with:
working-directory: ./bloc_flutter
deploy-to-netlify: ${{ github.ref_name == 'main' }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.BLOC_FLUTTER_NETLIFY_SITE_ID }}
bloc_library:
name: bloc_library
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis, Run Tests, and Build web app
uses: ./.github/actions/flutter_analysis_test_build
with:
working-directory: ./bloc_library
deploy-to-netlify: ${{ github.ref_name == 'main' }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.BLOC_LIBRARY_NETLIFY_SITE_ID }}
blocs:
name: blocs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis, Run Tests, and Build web app
uses: ./.github/actions/dart_analysis_and_tests
with:
working-directory: ./blocs
change_notifier_provider:
name: change_notifier_provider
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis, Run Tests, and Build web app
uses: ./.github/actions/flutter_analysis_test_build
with:
working-directory: ./change_notifier_provider
deploy-to-netlify: ${{ github.ref_name == 'main' }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.CHANGE_NOTIFIER_PROVIDER_NETLIFY_SITE_ID }}
freezed_provider_value_notifier:
name: freezed_provider_value_notifier
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis, Run Tests, and Build web app
uses: ./.github/actions/flutter_analysis_test_build
with:
working-directory: ./freezed_provider_value_notifier
deploy-to-netlify: ${{ github.ref_name == 'main' }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.FREEZED_PROVIDER_VALUE_NOTIFIER_NETLIFY_SITE_ID }}
inherited_widget:
name: inherited_widget
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis, Run Tests, and Build web app
uses: ./.github/actions/flutter_analysis_test_build
with:
working-directory: ./inherited_widget
deploy-to-netlify: ${{ github.ref_name == 'main' }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.INHERITED_WIDGET_NETLIFY_SITE_ID }}
mobx:
name: mobx
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis, Run Tests, and Build web app
uses: ./.github/actions/flutter_analysis_test_build
with:
working-directory: ./mobx
deploy-to-netlify: ${{ github.ref_name == 'main' }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.MOBX_NETLIFY_SITE_ID }}
mvi_base:
name: mvi_base
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis, Run Tests, and Build web app
uses: ./.github/actions/dart_analysis_and_tests
with:
working-directory: ./mvi_base
mvi_flutter:
name: mvi_flutter
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis, Run Tests, and Build web app
uses: ./.github/actions/flutter_analysis_test_build
with:
working-directory: ./mvi_flutter
deploy-to-netlify: ${{ github.ref_name == 'main' }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.MVI_NETLIFY_SITE_ID }}
redux:
name: redux
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis, Run Tests, and Build web app
uses: ./.github/actions/flutter_analysis_test_build
with:
working-directory: ./redux
deploy-to-netlify: ${{ github.ref_name == 'main' }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.REDUX_NETLIFY_SITE_ID }}
scoped_model:
name: scoped_model
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis, Run Tests, and Build web app
uses: ./.github/actions/flutter_analysis_test_build
with:
working-directory: ./scoped_model
deploy-to-netlify: ${{ github.ref_name == 'main' }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.SCOPED_MODEL_NETLIFY_SITE_IT }}
signals:
name: signals
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis, Run Tests, and Build web app
uses: ./.github/actions/flutter_analysis_test_build
with:
working-directory: ./signals
deploy-to-netlify: ${{ github.ref_name == 'main' }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.SIGNALS_NETLIFY_SITE_ID }}
simple_bloc_flutter:
name: simple_bloc_flutter
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis, Run Tests, and Build web app
uses: ./.github/actions/flutter_analysis_test_build
with:
working-directory: ./simple_bloc_flutter
deploy-to-netlify: ${{ github.ref_name == 'main' }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.SIMPLE_BLOC_NETLIFY_SITE_ID }}
simple_blocs:
name: simple_blocs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis, Run Tests, and Build web app
uses: ./.github/actions/dart_analysis_and_tests
with:
working-directory: ./simple_blocs
todos_repository_local_storage:
name: todos_repository_local_storage
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis, Run Tests, and Build web app
uses: ./.github/actions/flutter_analysis_test_build
with:
working-directory: ./todos_repository_local_storage
run-integration-tests: false
vanilla:
name: vanilla
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Static Analysis, Run Tests, and Build web app
uses: ./.github/actions/flutter_analysis_test_build
with:
working-directory: ./vanilla
deploy-to-netlify: ${{ github.ref_name == 'main' }}
netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
netlify-site-id: ${{ secrets.VANILLA_NETLIFY_SITE_ID }}
combine_and_upload_coverage:
name: Combine and Upload Coverage
runs-on: ubuntu-latest
needs:
- bloc_flutter
- bloc_library
- blocs
- change_notifier_provider
- freezed_provider_value_notifier
- inherited_widget
- mobx
- mvi_base
- mvi_flutter
- redux
- scoped_model
- signals
- simple_bloc_flutter
- simple_blocs
- todos_repository_local_storage
- vanilla
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download coverage artifacts
uses: actions/download-artifact@v4
with:
path: .
- name: Combine coverage files
run: |
combineCoverage() {
local artifact_dir=$1
local repo_dir=$2
# Extract the package directory path from the artifact name
# coverage-lcov-vanilla -> ./vanilla
local package_name=$(basename "$artifact_dir")
local package_dir="./${package_name#coverage-lcov-}"
escapedPath="$(echo $package_dir | sed 's/\//\\\//g')"
if [[ -d "$artifact_dir" ]]; then
# Find the lcov.info file in the artifact directory
for lcov_file in "$artifact_dir"/*.info; do
if [[ -f "$lcov_file" ]]; then
echo "Combining coverage from $package_dir"
# combine line coverage info from package tests to a common file
sed "s/^SF:lib/SF:$escapedPath\/lib/g" "$lcov_file" >> "$repo_dir/lcov.info"
break
fi
done
fi
}
# Initialize the combined coverage file
touch lcov.info
# Combine coverage from all downloaded artifacts
for artifact_dir in coverage-lcov-*/; do
if [[ -d "$artifact_dir" ]]; then
combineCoverage "$artifact_dir" "."
fi
done
echo "Combined coverage file created:"
ls -la lcov.info
echo "First few lines of combined coverage:"
head -10 lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./lcov.info
disable_search: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}