forked from flutter/devtools
-
Notifications
You must be signed in to change notification settings - Fork 0
227 lines (207 loc) · 6.85 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
# 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:
name: ${{ matrix.os }} Flutter Prep
outputs:
latest_flutter_candidate: ${{ steps.flutter-candidate.outputs.FLUTTER_CANDIDATE }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: git clone devtools
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Get Latest Flutter Candidate
id: flutter-candidate
run: |
# TODO(https://github.com/flutter/devtools/issues/4943): unpin once we can version
# solve with Dart 3.0.0
# LATEST_FLUTTER_CANDIDATE=$(./tool/latest_flutter_candidate.sh)
LATEST_FLUTTER_CANDIDATE='flutter-3.7-candidate.3'
echo "FLUTTER_CANDIDATE=$LATEST_FLUTTER_CANDIDATE" >> $GITHUB_OUTPUT
- name: Load Cached Flutter SDK
id: cache-flutter
uses: actions/cache@v3
with:
path: |
./flutter-sdk
key: flutter-sdk-${{ runner.os }}-${{ steps.flutter-candidate.outputs.FLUTTER_CANDIDATE }}
- if: ${{ steps.cache-flutter.outputs.cache-hit != 'true' }}
name: Clone Flutter SDK if none cached
run: |
git clone https://github.com/flutter/flutter.git ./flutter-sdk
cd flutter-sdk
git checkout $LATEST_FLUTTER_CANDIDATE
env:
LATEST_FLUTTER_CANDIDATE: ${{ steps.flutter-candidate.outputs.FLUTTER_CANDIDATE }}
- name: Assert that the Latest Flutter Candidate is checked out
run: |
cd flutter-sdk
HEAD_SHA=$(git rev-parse HEAD)
LATEST_FLUTTER_CANDIDATE_SHA=$(git rev-parse "origin/$LATEST_FLUTTER_CANDIDATE")
if [ "$HEAD_SHA" != "$LATEST_FLUTTER_CANDIDATE_SHA" ]; then
echo "::error ,title=Error checking out Latest Flutter Candidate::{expected HEAD to be at $LATEST_FLUTTER_CANDIDATE_SHA but got $HEAD_SHA}"
exit 1
fi
env:
LATEST_FLUTTER_CANDIDATE: ${{ steps.flutter-candidate.outputs.FLUTTER_CANDIDATE }}
- name: Setup Flutter SDK
run: |
./flutter-sdk/bin/flutter config --no-analytics
./flutter-sdk/bin/flutter doctor
./flutter-sdk/bin/cache/dart-sdk/bin/dart --disable-analytics
main:
name: main
needs: flutter-prep
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: git clone
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Load Cached Flutter SDK
uses: actions/cache@v3
with:
path: |
./flutter-sdk
key: flutter-sdk-${{ runner.os }}-${{ needs.flutter-prep.outputs.latest_flutter_candidate }}
- name: tool/bots.sh
env:
BOT: main
run: ./tool/bots.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@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Load Cached Flutter SDK
uses: actions/cache@v3
with:
path: |
./flutter-sdk
key: flutter-sdk-${{ runner.os }}-${{ needs.flutter-prep.outputs.latest_flutter_candidate }}
- name: tool/bots.sh
env:
BOT: ${{ matrix.bot }}
PLATFORM: vm
run: ./tool/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@755da8c3cf115ac066823e79a1e1788f8940201b
- name: Load Cached Flutter SDK
uses: actions/cache@v3
with:
path: |
./flutter-sdk
key: flutter-sdk-${{ runner.os }}-${{ needs.flutter-prep.outputs.latest_flutter_candidate }}
- name: tool/bots.sh
env:
BOT: ${{ matrix.bot }}
PLATFORM: vm
ONLY_GOLDEN: ${{ matrix.only_golden }}
run: ./tool/bots.sh
- name: Upload Golden Failure Artifacts
uses: actions/upload-artifact@v3
if: failure()
with:
name: golden_image_failures.${{ matrix.bot }}
path: packages/devtools_app/test/**/failures/*.png
integration-test:
name: integration-test ${{ matrix.bot }}
needs: flutter-prep
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
bot:
# Consider running integration tests in ddc mode, too.
- integration_dart2js
steps:
- name: git clone
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- name: Load Cached Flutter SDK
uses: actions/cache@v3
with:
path: |
./flutter-sdk
key: flutter-sdk-${{ runner.os }}-${{ needs.flutter-prep.outputs.latest_flutter_candidate }}
- name: tool/bots.sh
env:
BOT: ${{ matrix.bot }}
run: ./tool/bots.sh
# TODO(https://github.com/flutter/devtools/issues/1715): add a windows compatible version of tool/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@755da8c3cf115ac066823e79a1e1788f8940201b
#
# - name: tool/bots.sh
# env:
# BOT: ${{ matrix.bot }}
# PLATFORM: vm
# run: ./tool/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@755da8c3cf115ac066823e79a1e1788f8940201b
# - name: tool/bots.sh
# env:
# BOT: ${{ matrix.bot }}
# run: ./tool/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