Repository navigation
Expand file tree
/
Copy pathbuildvariants-and-tasks.in.yml
More file actions
632 lines (584 loc) · 17.6 KB
/
Copy pathbuildvariants-and-tasks.in.yml
File metadata and controls
632 lines (584 loc) · 17.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
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
<%
const UNIT_TESTS_BUILD_VARIANTS = [
{
name: 'unit-tests-ubuntu',
display_name: 'Unit Tests Ubuntu',
run_on: 'ubuntu2004-large',
},
{
name: 'unit-tests-windows',
display_name: 'Unit Tests Windows',
run_on: 'windows-vsCurrent-large',
},
{
name: 'unit-tests-rhel',
display_name: 'Unit Tests RHEL',
run_on: 'rhel80-large',
},
{
name: 'unit-tests-macos',
display_name: 'Unit Tests MacOS',
run_on: 'macos-14-arm64',
run_on_gui: 'macos-14-arm64-gui'
}
];
const PACKAGE_BUILD_VARIANTS = [
{
name: 'package-ubuntu',
display_name: 'Package Ubuntu',
// # NOTE: We are packaging on Ubuntu 18.04 in order to use glibc 2.27
// # when compiling/re-building addons. This ensures compatibility with other
// # debian platforms that have glibc 2.27 or newer.
run_on: 'ubuntu1804-large',
target_platform: 'ubuntu',
},
{
name: 'package-windows',
display_name: 'Package Windows',
run_on: 'windows-vsCurrent-large',
target_platform: 'windows',
},
{
name: 'package-rhel',
display_name: 'Package RHEL',
run_on: 'rhel80-large',
target_platform: 'rhel',
},
{
name: 'package-macos-x64',
display_name: 'Package MacOS Intel',
run_on: 'macos-14',
target_platform: 'macos',
},
{
name: 'package-macos-arm',
display_name: 'Package MacOS Arm64',
run_on: 'macos-14-arm64',
target_platform: 'macos-arm',
}
];
const TEST_PACKAGED_APP_BUILD_VARIANTS = [
{
name: 'test-packaged-app-ubuntu',
display_name: 'Ubuntu 20.04',
run_on: 'ubuntu2404-latest-large',
depends_on: 'package-ubuntu',
},
{
name: 'test-packaged-app-windows',
display_name: 'Windows 10',
run_on: 'windows-vsCurrent-large',
depends_on: 'package-windows',
},
{
name: 'test-packaged-app-rhel',
display_name: 'RHEL 8.0',
run_on: 'rhel9-latest-large',
depends_on: 'package-rhel',
},
{
name: 'test-packaged-app-macos-11-arm',
display_name: 'MacOS arm64 11',
run_on: 'macos-11-arm64-gui',
depends_on: 'package-macos-arm'
},
{
name: 'test-packaged-app-macos-11-x64',
display_name: 'MacOS x64 11',
run_on: 'macos-11-gui',
patchable: false,
depends_on: 'package-macos-x64'
},
{
name: 'test-packaged-app-macos-14-arm',
display_name: 'MacOS arm64 14',
run_on: 'macos-14-arm64-gui',
depends_on: 'package-macos-arm'
},
{
name: 'test-packaged-app-macos-14-x64',
display_name: 'MacOS x64 14',
run_on: 'macos-14-gui',
patchable: false,
depends_on: 'package-macos-x64'
},
// {
// name: 'test-packaged-app-macos-15-arm',
// display_name: 'MacOS arm64 15',
// run_on: 'macos-15-arm-gui',
// depends_on: 'package-macos-arm'
// },
// {
// name: 'test-packaged-app-macos-15-x64',
// display_name: 'MacOS x64 15',
// run_on: 'macos-15-gui',
// patchable: false,
// depends_on: 'package-macos-x64'
// }
];
const EOL_SERVER_VERSIONS = [
{ name: '44x-community', version: '4.4.x' },
{ name: '44x-enterprise', version: '4.4.x-enterprise' },
{ name: '5x-community', version: '5.x.x' },
{ name: '5x-enterprise', version: '5.x.x-enterprise' }
];
const MAINTAINED_SERVER_VERSIONS = [
{ name: '60x-community', version: '6.0.x' },
{ name: '60x-enterprise', version: '6.0.x-enterprise' },
{ name: '70x-community', version: '7.0.x' },
{ name: '70x-enterprise', version: '7.0.x-enterprise' },
{ name: '80x-community', version: '8.0.x' },
{ name: '80x-enterprise', version: '8.0.x-enterprise' },
];
const LATEST_MAINTAINED_SERVER_VERSION =
MAINTAINED_SERVER_VERSIONS[MAINTAINED_SERVER_VERSIONS.length - 1];
const TEST_LATEST_ALPHA_SERVER_VERSION = { name: 'latest-alpha', version: 'latest-alpha-enterprise' };
const SERVER_VERSIONS = [
...EOL_SERVER_VERSIONS,
...MAINTAINED_SERVER_VERSIONS,
TEST_LATEST_ALPHA_SERVER_VERSION
];
const COMPASS_DISTRIBUTIONS = ["compass", "compass-isolated", "compass-readonly"];
const BROWSERS = ["chrome", "firefox"];
const E2E_TEST_GROUPS_NUMBER = 3;
const E2E_TEST_GROUPS = Array.from({ length: E2E_TEST_GROUPS_NUMBER }).map((_, i) => ({number: i + 1}));
%>
#
# Build Variants
#
buildvariants:
- name: check
display_name: Check
run_on: ubuntu2004-large
tasks:
- name: check
# unit-tests
<% for (const buildVariant of UNIT_TESTS_BUILD_VARIANTS) { %>
- name: <%= buildVariant.name %>
display_name: <%= buildVariant.display_name %>
run_on: <%= buildVariant.run_on %>
tasks:
- name: test
- name: test-electron
<% if (buildVariant.run_on_gui) { %>
run_on: <%= buildVariant.run_on_gui %>
<% } %>
<% } %>
# package
<% for (const buildVariant of PACKAGE_BUILD_VARIANTS) { %>
- name: <%= buildVariant.name %>
expansions:
target_platform: <%= buildVariant.target_platform %>
display_name: <%= buildVariant.display_name %>
run_on: <%= buildVariant.run_on %>
tasks:
<% for (const distribution of COMPASS_DISTRIBUTIONS) { %>
- name: package-<%= distribution %>
<% } %>
<% } %>
- name: smoketest-packaged-app
display_name: Smoke Test via GitHub Actions
run_on: ubuntu2004-large
depends_on:
<% for (const distribution of COMPASS_DISTRIBUTIONS) { %>
<% for (const buildVariant of PACKAGE_BUILD_VARIANTS) { %>
- name: package-<%= distribution %>
variant: <%= buildVariant.name %>
<% } %>
<% } %>
tasks:
- name: smoketest-packaged-app
- name: test-eol-servers
display_name: Test EoL Servers
run_on: ubuntu1804-large
patchable: false
depends_on:
- name: package-compass
variant: package-ubuntu
tasks:
<% for (const serverVersion of EOL_SERVER_VERSIONS) { %>
<% for (const group of E2E_TEST_GROUPS) { %>
- name: test-server-<%= serverVersion.name %>-<%= group.number %>
<% } %>
<% } %>
- name: test-maintained-servers
display_name: Test Maintained Servers
run_on: ubuntu2004-large
patchable: true
depends_on:
- name: package-compass
variant: package-ubuntu
tasks:
<% for (const serverVersion of MAINTAINED_SERVER_VERSIONS) { %>
<% for (const group of E2E_TEST_GROUPS) { %>
- name: test-server-<%= serverVersion.name %>-<%= group.number %>
<% } %>
<% } %>
- name: test-latest-alpha
display_name: Test Latest Alpha Server
run_on: ubuntu2004-large
patchable: false
depends_on:
- name: package-compass
variant: package-ubuntu
tasks:
<% for (const group of E2E_TEST_GROUPS) { %>
- name: test-server-<%= TEST_LATEST_ALPHA_SERVER_VERSION.name %>-<%= group.number %>
<% } %>
# test-packaged-app
<% for (const buildVariant of TEST_PACKAGED_APP_BUILD_VARIANTS) { %>
- name: <%= buildVariant.name %>
display_name: Test Packaged App <%= buildVariant.display_name %>
run_on: <%= buildVariant.run_on %>
patchable: <%= buildVariant.patchable ?? true %>
depends_on:
- name: package-compass
variant: <%= buildVariant.depends_on %>
tasks:
<% for (const group of E2E_TEST_GROUPS) { %>
<% if (['test-packaged-app-macos-11-arm', 'test-packaged-app-macos-11-x64'].includes(buildVariant.name)) { %>
- name: test-packaged-app-macos13-<%= group.number %>
<% } else { %>
- name: test-packaged-app-<%= group.number %>
<% } %>
<% } %>
<% } %>
- name: publish
display_name: Publish Artifacts
run_on: ubuntu2004-large
tasks:
- name: publish
- name: publish-dev-release-info
- name: create_static_analysis_report
- name: connectivity-tests
display_name: Connectivity Tests
run_on: ubuntu2004-large
tasks:
- name: test-connectivity
- name: e2e-coverage
display_name: E2E Coverage
run_on: ubuntu2004-large
tasks:
<% for(const group of E2E_TEST_GROUPS) { %>
- name: e2e-coverage-<%= group.number %>
<% } %>
- name: csfle-tests
display_name: CSFLE Tests
run_on: ubuntu2004-large
tasks:
- name: test-csfle
- name: test-web-sandbox
display_name: Test Web Sandbox
run_on: ubuntu2004-large
tasks:
<% for (const browser of BROWSERS) { %>
<% for(const group of E2E_TEST_GROUPS) { %>
- name: test-web-sandbox-<%= browser %>-<%= group.number %>
<% } %>
<% } %>
- name: test-can-bundle-compass-web
display_name: Test Can Bundle Compass Web
run_on: ubuntu2004-large
tasks:
- name: test-can-bundle-compass-web
- name: test-web-sandbox-atlas-cloud
display_name: Test Web Sandbox (w/ Atlas Cloud login)
run_on: ubuntu2004-large
tasks:
- name: test-web-sandbox-atlas-cloud
- name: generate-vulnerability-report
display_name: Vulnerability Report
run_on: ubuntu2004-large
tasks:
- name: generate-vulnerability-report
#
# Tasks
#
tasks:
- name: check
tags: ['required-for-publish', 'run-on-pr']
commands:
- func: prepare
- func: install
- func: bootstrap
- func: check
- name: test
tags:
- required-for-publish
- run-on-pr
- assigned_to_jira_team_compass_compass
- foliage_creates_breaking_commit
commands:
- func: prepare
- func: install
- func: bootstrap
- func: test
vars:
debug: 'hadron*,mongo*'
mongodb_version: <%= LATEST_MAINTAINED_SERVER_VERSION.version %>
- name: test-electron
tags: ['required-for-publish', 'run-on-pr']
commands:
- func: prepare
- func: install
- func: bootstrap
- func: test-electron
vars:
debug: 'hadron*,mongo*'
mongodb_version: <%= LATEST_MAINTAINED_SERVER_VERSION.version %>
- name: test-connectivity
tags: ['required-for-publish', 'run-on-pr']
commands:
- func: clone
- func: test-connectivity
vars:
debug: 'compass*,electron*,hadron*,mongo*'
mongodb_version: <%= LATEST_MAINTAINED_SERVER_VERSION.version %>
- name: test-csfle
tags: ['required-for-publish', 'run-on-pr']
commands:
- func: prepare
- func: install
- func: bootstrap
- func: test-csfle
vars:
debug: 'compass*,electron*,hadron*,mongo*'
mongodb_version: <%= LATEST_MAINTAINED_SERVER_VERSION.version %>
<% for(const group of E2E_TEST_GROUPS) { %>
- name: e2e-coverage-<%= group.number %>
tags: ['required-for-publish', 'run-on-pr']
commands:
- func: prepare
- func: install
- func: bootstrap
- func: e2e-coverage
vars:
e2e_test_groups: <%= E2E_TEST_GROUPS.length %>
e2e_test_group: <%= group.number %>
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
mongodb_version: <%= LATEST_MAINTAINED_SERVER_VERSION.version %>
<% } %>
- name: generate-vulnerability-report
tags: ['required-for-publish', 'run-on-pr']
commands:
- func: prepare
- func: install
- func: bootstrap
- func: generate-vulnerability-report
vars:
debug: 'compass*,electron*,hadron*,mongo*'
# Publish happens in one go to make sure we are not creating multiple github
# releases in parallel
- name: publish
# Does a dry-run: doesn't actually publishes, but checks that all files
# exist and we are not trying to do a "broken" publish
tags: ['run-on-pr']
depends_on:
- name: '.required-for-publish'
variant: '*'
commands:
- func: prepare
- func: install
- func: bootstrap
vars:
scope: mongodb-compass
- func: get-all-artifacts
- func: publish
- name: publish-dev-release-info
tags: []
depends_on:
- name: 'publish'
variant: '*'
commands:
- func: prepare
- func: publish-dev-release-info
<% for (const distribution of COMPASS_DISTRIBUTIONS) { %>
- name: package-<%= distribution %>
tags: ['required-for-publish', 'run-on-pr', 'package-task']
commands:
- func: prepare
- func: install
- func: bootstrap
vars:
scope: '@mongodb-js/webpack-config-compass'
- func: apply-compass-target-expansion
vars:
compass_distribution: <%= distribution %>
- func: spawn-signing-server
- func: package
vars:
debug: 'hadron*,mongo*,compass*,electron*,sign*'
compass_distribution: <%= distribution %>
- func: verify-artifacts
- func: save-all-artifacts
vars:
compass_distribution: <%= distribution %>
<% } %>
- name: smoketest-packaged-app
tags: ['required-for-publish', 'run-on-pr']
commands:
- func: prepare
- func: install
- func: bootstrap
vars:
scope: '@mongodb-js/compass-smoke-tests'
- func: smoketest-on-github-actions
vars:
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
<% for (const serverVersion of SERVER_VERSIONS) { %>
<% for(const group of E2E_TEST_GROUPS) { %>
- name: test-server-<%= serverVersion.name %>-<%= group.number %>
tags:
- required-for-publish
- run-on-pr
commands:
- func: prepare
- func: install
- func: bootstrap
vars:
scope: 'compass-e2e-tests'
- func: apply-compass-target-expansion
vars:
compass_distribution: compass
- func: get-packaged-app
vars:
compass_distribution: compass
- func: test-packaged-app
vars:
mongodb_version: '<%= serverVersion.version %>'
compass_distribution: compass
e2e_test_groups: <%= E2E_TEST_GROUPS.length %>
e2e_test_group: <%= group.number %>
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
<% } %>
<% } %>
<% for(const group of E2E_TEST_GROUPS) { %>
- name: test-packaged-app-<%= group.number %>
tags:
- required-for-publish
- run-on-pr
- assigned_to_jira_team_compass_compass
- foliage_check_task_only
commands:
- func: prepare
- func: install
- func: bootstrap
vars:
scope: 'compass-e2e-tests'
- func: apply-compass-target-expansion
vars:
compass_distribution: compass
- func: get-packaged-app
vars:
compass_distribution: compass
- func: test-packaged-app
vars:
mongodb_version: <%= LATEST_MAINTAINED_SERVER_VERSION.version %>
compass_distribution: compass
e2e_test_groups: <%= E2E_TEST_GROUPS.length %>
e2e_test_group: <%= group.number %>
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
- name: test-packaged-app-macos13-<%= group.number %>
tags:
- required-for-publish
- run-on-pr
- assigned_to_jira_team_compass_compass
- foliage_check_task_only
commands:
- func: prepare
- func: install
- func: bootstrap
vars:
scope: 'compass-e2e-tests'
- func: apply-compass-target-expansion
vars:
compass_distribution: compass
- func: get-packaged-app
vars:
compass_distribution: compass
- func: test-packaged-app
vars:
mongodb_version: 8.0.5
compass_distribution: compass
e2e_test_groups: <%= E2E_TEST_GROUPS.length %>
e2e_test_group: <%= group.number %>
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
<% } %>
<% for (const browser of BROWSERS) { %>
<% for(const group of E2E_TEST_GROUPS) { %>
- name: test-web-sandbox-<%= browser %>-<%= group.number %>
tags:
- required-for-publish
- run-on-pr
- assigned_to_jira_team_compass_compass
- foliage_check_task_only
commands:
- func: prepare
- func: install
- func: bootstrap
vars:
scope: 'compass-e2e-tests'
- func: apply-compass-target-expansion
vars:
compass_distribution: compass
- func: test-web-sandbox
vars:
mongodb_version: <%= LATEST_MAINTAINED_SERVER_VERSION.version %>
browser_name: '<%= browser %>'
compass_distribution: compass
e2e_test_groups: <%= E2E_TEST_GROUPS.length %>
e2e_test_group: <%= group.number %>
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
<% } %>
<% } %>
- name: test-can-bundle-compass-web
tags:
- run-on-pr
- assigned_to_jira_team_compass_compass
- foliage_check_task_only
commands:
- func: prepare
- func: install
- func: bootstrap
- func: compile-compass-web
vars:
debug: 'compass*,electron*,hadron*,mongo*'
- name: test-web-sandbox-atlas-cloud
tags:
- required-for-publish
- run-on-pr
- assigned_to_jira_team_compass_compass
- foliage_check_task_only
# These tests are expensive (literally) and shouldn't be running on PRs
patchable: false
commands:
- func: prepare
- func: install
- func: bootstrap
- func: test-web-sandbox-atlas-cloud
vars:
compass_distribution: compass
debug: 'compass-e2e-tests*,electron*,hadron*,mongo*'
- name: create_static_analysis_report
tags: ['required-for-publish', 'run-on-pr']
depends_on:
- name: ".package-task"
variant: "*"
commands:
- func: prepare
- func: install
<%
let firstPartyDepsFilenames = [];
for (const compassDistribution of COMPASS_DISTRIBUTIONS) {
const filenames = PACKAGE_BUILD_VARIANTS.map(
(variant) => `first-party-deps-${compassDistribution}-${variant.name}.json`
);
for (const filename of filenames) {
firstPartyDepsFilenames.push(filename); %>
- func: get_first_party_dependency_list
vars:
filename: <%= filename %>
<% } } %>
- func: create_static_analysis_report
vars:
first_party_dependency_filenames: <%= firstPartyDepsFilenames.map(f => '.sbom/' + f).join(',') %>