-
Notifications
You must be signed in to change notification settings - Fork 2
343 lines (338 loc) · 10.6 KB
/
test.yml
File metadata and controls
343 lines (338 loc) · 10.6 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
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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
name: Test (All platform)
on:
push:
branches:
- 'main'
- 'releases-**'
paths:
- '.github/workflows/build.yml'
- '.github/workflows/build_**.yml'
- '.github/workflows/test.yml'
- 'build_dependencies/**'
- 'fonts/**'
- 'lib/**'
- 'macos/**'
- 'linux/**'
- 'windows/**'
- 'packages/**'
- 'test/**'
- 'analysis_options.yaml'
- 'test.yaml'
- 'build.yaml'
- 'dart_test.yaml'
- 'pubspec.yaml'
# paths-ignore:
# - '**/README.md'
# - '**/README.md'
pull_request:
types:
- opened
- reopened
- ready_for_review
- synchronize
branches:
- 'main'
paths:
- '.github/workflows/build.yml'
- 'build_dependencies/**'
- 'fonts/**'
- 'lib/**'
- 'macos/**'
- 'linux/**'
- 'windows/**'
- 'packages/**'
- 'test/**'
- 'analysis_options.yaml'
- 'build.yaml'
- 'dart_test.yaml'
- 'pubspec.yaml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2.8.0
with:
channel: 'stable'
- name: Install Dependencies
run: |
flutter packages get
- name: Lint and Format
run: |
flutter pub run melos run lint:all
test_windows:
env:
MACHINE_OS: windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2.8.0
with:
channel: 'stable'
- name: Install Dependencies
run: |
flutter packages get
- name: Unit test
run: |
flutter pub run melos test --no-select
test_ubuntu:
env:
MACHINE_OS: linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2.8.0
with:
channel: 'stable'
- name: Install Dependencies
run: |
flutter packages get
- name: Unit test
run: |
flutter pub run melos test --no-select
test_macos:
env:
MACHINE_OS: macos
runs-on: macos-latest
steps:
- name: Test (TODO removed)
run : |
top -l 1 -s 0 | grep PhysMem | awk '{print $2}'
top -l 1 -s 0 | grep PhysMem | awk '{print $6}'
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2.8.0
with:
channel: 'stable'
- name: Install Dependencies
run: |
flutter packages get
- name: Unit test
run: |
flutter pub run melos test --no-select
hard_resources_preparation:
needs:
- test_windows
- test_ubuntu
- test_macos
runs-on: ubuntu-latest
steps:
- name: Download a file
uses: carlosperate/download-file-action@v1
id: download-file
with:
file-url: 'https://dl.dropboxusercontent.com/s/i0s17qbooewf8le/minimal_resources.zip'
file-name: 'minimal_resources.zip'
- name: Print the file path (new-folder-to-be-created/new_filename.tar.gz)
run: echo "The file was downloaded to ${{ steps.download-file.outputs.file-path }}"
- name: Pass test assets
uses: actions/upload-artifact@v3
with:
name: minimal_resources
path: minimal_resources.zip
# - uses: montudor/action-zip@v1
# with:
# args: unzip -qq minimal_resources.zip
# - name: Cache multiple paths
# uses: actions/cache@v3
# with:
# key: ${{ runner.os }}-minimal_resources
# path: |
# ${{ github.workspace }}/minimal_resources
test_heavy_windows:
needs:
- hard_resources_preparation
- test_windows
env:
MACHINE_OS: windows
DART_TEST_RESOURCES: ${{ github.workspace }}\minimal_resources
JAVA_VERSION: pass
runs-on: windows-latest
steps:
- name: Set variables
run: |
# set JAVA_17=%PROJECT_PATH%\zulu8.60.0.21-ca-jdk8.0.322-win_x64\bin\java.exe
# set JAVA_8=%PROJECT_PATH%\zulu17.32.13-ca-jdk17.0.2-win_x64\bin\java.exe
# set JAVA_17=%JAVA_HOME_17_X64%\bin\java.exe
# set JAVA_8=%JAVA_HOME_8_X64%\bin\java.exe
# set PATH=%JAVA_HOME_17_X64%\bin;%PATH%
"JAVA_17=$env:JAVA_HOME_17_X64\bin\java.exe" >> $env:GITHUB_ENV
"JAVA_8=$env:JAVA_HOME_8_X64\bin\java.exe" >> $env:GITHUB_ENV
"$env:JAVA_HOME_17_X64\bin" >> $env:GITHUB_PATH
# $env:Path = "$env:JAVA_HOME_17_X64\bin" + ";" + $env:Path
# $env:JAVA_17 = "$env:JAVA_HOME_17_X64\bin\java.exe"
# $env:JAVA_8 = "$env:JAVA_HOME_8_X64\bin\java.exe"
- name: Print variables
run: |
echo "DART_TEST_RESOURCES: $env:DART_TEST_RESOURCES"
echo "JAVA_17: $env:JAVA_17"
echo "JAVA_8: $env:JAVA_8"
echo "JAVA_HOME_17_X64: $env:JAVA_HOME_17_X64"
echo "JAVA_HOME_8_X64: $env:JAVA_HOME_8_X64"
echo "MACHINE_OS: $env:MACHINE_OS"
echo "PATH: $env:PATH"
# - name: Restore test resources
# uses: actions/cache@v3
# with:
# key: ${{ runner.os }}-minimal_resources
# path: |
# ${{ github.workspace }}/minimal_resources
- uses: actions/checkout@v3
- name: Download test resources
uses: actions/download-artifact@v3
with:
name: minimal_resources
- name: Extract test assets
run: |
7z x minimal_resources.zip
echo %CD%
dir
# - name: Setup Java
# run: |
# .\.github\workflows\scripts\windows_integration_setup.bat
- uses: subosito/flutter-action@v2.8.0
with:
channel: 'stable'
- name: Install Dependencies
run: |
flutter packages get
- name: Integration test
run: |
flutter pub run melos test:integration --no-select
test_heavy_ubuntu:
needs:
- hard_resources_preparation
- test_ubuntu
env:
MACHINE_OS: linux
DART_TEST_RESOURCES: ${{ github.workspace }}/minimal_resources
JAVA_VERSION: pass
runs-on: ubuntu-latest
steps:
- name: Set variables
run: |
# export JAVA_17=$JAVA_HOME_17_X64/bin/java
# export JAVA_8=$JAVA_HOME_8_X64/bin/java
# export PATH=$JAVA_HOME_17_X64/bin:$PATH
echo "JAVA_17=$JAVA_HOME_17_X64/bin/java" >> $GITHUB_ENV
echo "JAVA_8=$JAVA_HOME_8_X64/bin/java" >> $GITHUB_ENV
echo "$JAVA_HOME_17_X64/bin" >> $GITHUB_PATH
# echo "{path}" >> $GITHUB_PATH
# export JAVA_17=$PWD/zulu17.32.13-ca-jdk17.0.2-linux_x64/bin/java
# export JAVA_8=$PWD/zulu8.60.0.21-ca-jdk8.0.322-linux_x64/bin/java
- name: Print variables
run: |
echo "DART_TEST_RESOURCES: $DART_TEST_RESOURCES"
echo "JAVA_17: $JAVA_17"
echo "JAVA_8: $JAVA_8"
echo "JAVA_HOME_17_X64: $JAVA_HOME_17_X64"
echo "JAVA_HOME_8_X64: $JAVA_HOME_8_X64"
echo "MACHINE_OS: $MACHINE_OS"
echo "PATH: $PATH"
# - name: Restore test resources
# uses: actions/cache@v3
# with:
# key: ${{ runner.os }}-minimal_resources
# path: |
# ${{ github.workspace }}/minimal_resources
- uses: actions/checkout@v3
- name: Download test resources
uses: actions/download-artifact@v3
with:
name: minimal_resources
- name: Extract test assets
run: |
7z x minimal_resources.zip
chmod +x minimal_resources/process_cleaner_repository/cube_java_linux
echo $PWD
ls
# - name: Setup Java
# run: |
# ./.github/workflows/scripts/linux_integration_setup.sh
- uses: subosito/flutter-action@v2.8.0
with:
channel: 'stable'
- name: Install Dependencies
run: |
flutter packages get
- name: Integration test
run: |
flutter pub run melos test:integration --no-select
test_heavy_macos:
needs:
- hard_resources_preparation
- test_macos
env:
MACHINE_OS: macos
DART_TEST_RESOURCES: ${{ github.workspace }}/minimal_resources
JAVA_VERSION: pass
runs-on: macos-latest
steps:
- name: Confirm variables
run: |
# export JAVA_17=$JAVA_HOME_17_X64bin/java
# export JAVA_8=$JAVA_HOME_8_X64bin/java
# export PATH=$JAVA_HOME_17_X64bin:$PATH
echo "JAVA_17=$JAVA_HOME_17_X64/bin/java" >> $GITHUB_ENV
echo "JAVA_8=$JAVA_HOME_8_X64/bin/java" >> $GITHUB_ENV
echo "$JAVA_HOME_17_X64/bin" >> $GITHUB_PATH
# export JAVA_17=$PWD/zulu17.32.13-ca-jdk17.0.2-macosx_x64/bin/java
# export JAVA_8=$PWD/zulu8.60.0.21-ca-jdk8.0.322-macosx_x64/bin/java
- name: Print variables
run: |
echo "DART_TEST_RESOURCES: $DART_TEST_RESOURCES"
echo "JAVA_17: $JAVA_17"
echo "JAVA_8: $JAVA_8"
echo "JAVA_HOME_17_X64: $JAVA_HOME_17_X64"
echo "JAVA_HOME_8_X64: $JAVA_HOME_8_X64"
echo "MACHINE_OS: $MACHINE_OS"
echo "PATH: $PATH"
# - name: Restore test resources
# uses: actions/cache@v3
# with:
# key: ${{ runner.os }}-minimal_resources
# path: |
# ${{ github.workspace }}/minimal_resources
- uses: actions/checkout@v3 # checkout will clear the workspace first...
- name: Download test resources
uses: actions/download-artifact@v3
with:
name: minimal_resources
- name: Extract test assets
run: |
7z x minimal_resources.zip
chmod +x minimal_resources/process_cleaner_repository/cube_java_macos
echo $PWD
ls
# - name: Setup Java
# run: |
# ./.github/workflows/scripts/macos_integratin_setup.sh
- uses: subosito/flutter-action@v2.8.0
with:
channel: 'stable'
- name: Install Dependencies
run: |
flutter packages get
- name: Integration test
run: |
flutter pub run melos test:integration --no-select
build_windows:
needs:
- test_heavy_windows
uses: ./.github/workflows/build_windows.yml
with:
postfix: ${{ github.sha }}
build_ubuntu:
needs:
- test_heavy_ubuntu
uses: ./.github/workflows/build_linux.yml
with:
postfix: ${{ github.sha }}
build_macos:
needs:
- test_heavy_macos
uses: ./.github/workflows/build_macos.yml
with:
postfix: ${{ github.sha }}