forked from flutter/devtools
-
Notifications
You must be signed in to change notification settings - Fork 2
323 lines (302 loc) · 10.1 KB
/
build.yaml
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
name: devtools
on:
pull_request:
push:
branches:
- master
# Declare default permissions as read only.
permissions: read-all
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
flutter-prep:
uses: ./.github/workflows/flutter-prep.yaml
main:
name: main
needs: flutter-prep
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: git clone
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
- name: Load Cached Flutter SDK
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
./flutter-sdk
key: flutter-sdk-${{ runner.os }}-${{ needs.flutter-prep.outputs.latest_flutter_candidate }}
- name: tool/ci/bots.sh
env:
BOT: main
run: ./tool/ci/bots.sh
dcm:
name: Dart Code Metrics
needs: flutter-prep
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Clone Flutter DevTools
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
with:
ref: "${{ github.event.pull_request.head.sha }}"
- name: Load Cached Flutter SDK
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
./flutter-sdk
key: flutter-sdk-${{ runner.os }}-${{ needs.flutter-prep.outputs.latest_flutter_candidate }}
- name: Run tool/ci/bots.sh
run: ./tool/ci/bots.sh
- name: Install DCM
run: |
sudo apt-get update
wget -qO- https://dcm.dev/pgp-key.public | sudo gpg --dearmor -o /usr/share/keyrings/dcm.gpg
echo 'deb [signed-by=/usr/share/keyrings/dcm.gpg arch=amd64] https://dcm.dev/debian stable main' | sudo tee /etc/apt/sources.list.d/dart_stable.list
sudo apt-get update
sudo apt-get install dcm=1.11.0-1
sudo chmod +x /usr/bin/dcm
echo "$(dcm --version)"
- name: Setup Dart SDK
uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
- name: Run DCM on root
run: |
dcm analyze packages/devtools_app packages/devtools_shared packages/devtools_test
test-packages:
name: ${{ matrix.package }} test
needs: flutter-prep
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package:
- devtools_app_shared
- devtools_extensions
- devtools_shared
steps:
- name: git clone
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
- name: Load Cached Flutter SDK
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
./flutter-sdk
key: flutter-sdk-${{ runner.os }}-${{ needs.flutter-prep.outputs.latest_flutter_candidate }}
- name: tool/ci/package_tests.sh
env:
PACKAGE: ${{ matrix.package }}
run: ./tool/ci/package_tests.sh
test:
name: ${{ matrix.bot }}
needs: flutter-prep
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
bot:
- build_ddc
- build_dart2js
- test_ddc
- test_dart2js
steps:
- name: git clone
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
- name: Load Cached Flutter SDK
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
./flutter-sdk
key: flutter-sdk-${{ runner.os }}-${{ needs.flutter-prep.outputs.latest_flutter_candidate }}
- name: tool/ci/bots.sh
env:
BOT: ${{ matrix.bot }}
PLATFORM: vm
run: ./tool/ci/bots.sh
macos-test:
needs: flutter-prep
name: macos goldens ${{ matrix.bot }}
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
bot:
- test_dart2js
only_golden:
- true
steps:
- name: git clone
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
- name: Load Cached Flutter SDK
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
./flutter-sdk
key: flutter-sdk-${{ runner.os }}-${{ needs.flutter-prep.outputs.latest_flutter_candidate }}
- name: tool/ci/bots.sh
env:
BOT: ${{ matrix.bot }}
PLATFORM: vm
ONLY_GOLDEN: ${{ matrix.only_golden }}
run: ./tool/ci/bots.sh
- name: Upload Golden Failure Artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
if: failure()
with:
name: golden_image_failures.${{ matrix.bot }}
path: packages/devtools_app/test/**/failures/*.png
- name: Notify of Quick Fix
if: failure()
env:
WORKFLOW_ID: ${{ github.run_id }}
run: |
echo "::notice title=To Quickly Fix Goldens:: Run \`devtools_tool fix-goldens --run-id=$WORKFLOW_ID\` on your local branch."
devtools-app-integration-test:
name: devtools_app integration-test ${{ matrix.bot }} - ${{ matrix.device }} - shard ${{ matrix.shard }}
needs: flutter-prep
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
# Consider running integration tests in ddc mode, too.
bot: [integration_dart2js]
device: [flutter, flutter-web, dart-cli]
# Option 1/1 will run all tests for a device in a single shard.
# Option 1/2 and 2/2 should be enabled to run tests for a device in 2 shards.
shard: [1/1, 1/2, 2/2, 1/3, 2/3, 3/3]
exclude:
# The 'flutter' device should be ran in three shards.
- device: flutter
shard: 1/1
- device: flutter
shard: 1/2
- device: flutter
shard: 2/2
# The 'flutter-web' device should be ran in two shards.
- device: flutter-web
shard: 1/1
- device: flutter-web
shard: 1/3
- device: flutter-web
shard: 2/3
- device: flutter-web
shard: 3/3
# The 'dart-cli' device can be ran in a single shard.
- device: dart-cli
shard: 1/2
- device: dart-cli
shard: 2/2
- device: dart-cli
shard: 1/3
- device: dart-cli
shard: 2/3
- device: dart-cli
shard: 3/3
steps:
- name: git clone
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
- name: Load Cached Flutter SDK
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
./flutter-sdk
key: flutter-sdk-${{ runner.os }}-${{ needs.flutter-prep.outputs.latest_flutter_candidate }}
- name: tool/ci/bots.sh
env:
BOT: ${{ matrix.bot }}
DEVICE: ${{ matrix.device }}
SHARD: ${{ matrix.shard }}
DEVTOOLS_PACKAGE: devtools_app
run: ./tool/ci/bots.sh
- name: Upload Golden Failure Artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
if: failure()
with:
name: golden_image_failures.${{ matrix.bot }}
path: packages/devtools_app/integration_test/**/failures/*.png
devtools-extensions-integration-test:
name: devtools_extensions integration-test ${{ matrix.bot }}
needs: flutter-prep
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Consider running integration tests in ddc mode, too.
bot: [integration_dart2js]
steps:
- name: git clone
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
- name: Load Cached Flutter SDK
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
./flutter-sdk
key: flutter-sdk-${{ runner.os }}-${{ needs.flutter-prep.outputs.latest_flutter_candidate }}
- name: tool/ci/bots.sh
env:
BOT: ${{ matrix.bot }}
DEVTOOLS_PACKAGE: devtools_extensions
run: ./tool/ci/bots.sh
benchmarks:
name: benchmarks
needs: flutter-prep
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: git clone
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
- name: Load Cached Flutter SDK
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
./flutter-sdk
key: flutter-sdk-${{ runner.os }}-${{ needs.flutter-prep.outputs.latest_flutter_candidate }}
- name: tool/ci/benchmark_tests.sh
run: ./tool/ci/benchmark_tests.sh
# TODO(https://github.com/flutter/devtools/issues/1715): add a windows compatible version of tool/ci/bots.sh
# and run it from this job.
# windows-test:
# name: windows ${{ matrix.bot }}
# runs-on: windows-latest
# strategy:
# fail-fast: false
# matrix:
# bot:
# - test_dart2js
# steps:
# - name: git clone
# uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
#
# - name: tool/ci/bots.sh
# env:
# BOT: ${{ matrix.bot }}
# PLATFORM: vm
# run: ./tool/ci/bots.sh
# TODO(https://github.com/flutter/devtools/issues/1987): rewrite integration tests.
# integration:
# name: integration ${{ matrix.bot }}
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# bot:
# - integration_ddc
# - integration_dart2js
# steps:
# - name: git clone
# uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
# - name: tool/ci/bots.sh
# env:
# BOT: ${{ matrix.bot }}
# run: ./tool/ci/bots.sh
# TODO(https://github.com/flutter/devtools/issues/2437):
# PLATFORM=chrome is going away. We need to move these tests to run with
# chromedriver.
# - BOT=test_ddc PLATFORM=chrome
# PLATFORM=chrome is going away. We need to move these tests to run with
# chromedriver.
# - BOT=test_dart2js PLATFORM=chrome