forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathbuild-matrix.rb
107 lines (102 loc) · 2.77 KB
/
build-matrix.rb
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
require "json"
require "optparse"
BASE_MATRIX_ENTRIES = [
{
"build_os": "ubuntu-18.04",
"agent_query": "ubuntu-20.04",
"target": "ubuntu18.04_x86_64",
"container": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-18.04",
"run_stdlib_test": true,
"run_full_test": false,
"run_e2e_test": true,
"build_hello_wasm": true,
"clean_build_dir": false,
"free_disk_space": true
},
{
"build_os": "ubuntu-20.04",
"agent_query": "ubuntu-20.04",
"target": "ubuntu20.04_x86_64",
"container": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-20.04",
"run_stdlib_test": true,
"run_full_test": false,
"run_e2e_test": true,
"build_hello_wasm": true,
"clean_build_dir": false,
"free_disk_space": true
},
{
"build_os": "ubuntu-22.04",
"agent_query": "ubuntu-22.04",
"target": "ubuntu22.04_x86_64",
"container": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-22.04",
"run_stdlib_test": true,
"run_full_test": false,
"run_e2e_test": true,
"build_hello_wasm": true,
"clean_build_dir": false,
"free_disk_space": true
},
{
"build_os": "amazon-linux-2",
"agent_query": "ubuntu-22.04",
"target": "amazonlinux2_x86_64",
"container": "ghcr.io/swiftwasm/swift-ci:main-amazon-linux-2",
"run_stdlib_test": false,
"run_full_test": false,
"run_e2e_test": false,
"build_hello_wasm": true,
"clean_build_dir": false,
"free_disk_space": true
},
{
"build_os": "macos-12",
"agent_query": "macos-12",
"target": "macos_x86_64",
"run_stdlib_test": false,
"run_full_test": false,
"run_e2e_test": false,
"build_hello_wasm": false,
"clean_build_dir": false
},
{
"build_os": "macos-11",
"agent_query": ["self-hosted", "macOS", "ARM64"],
"target": "macos_arm64",
"run_stdlib_test": false,
"run_full_test": false,
"run_e2e_test": false,
"build_hello_wasm": true,
"clean_build_dir": true
}
]
def main
options = {}
OptionParser.new do |opts|
opts.banner = "Usage: build-matrix.rb [options]"
opts.on("--runner [JSON FILE]", "Path to runner data file") do |v|
options[:runner] = v
end
end.parse!
matrix_entries = BASE_MATRIX_ENTRIES.dup
if options[:runner]
runner = JSON.parse(File.read(options[:runner]))
if label = runner["outputs"]["ubuntu20_04_aarch64-label"]
matrix_entries << {
"build_os": "ubuntu-20.04",
"agent_query": label,
"target": "ubuntu20.04_aarch64",
"container": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-20.04",
"run_stdlib_test": false,
"run_full_test": false,
"run_e2e_test": false,
"build_hello_wasm": true,
"clean_build_dir": false
}
end
end
print JSON.generate(matrix_entries)
end
if $0 == __FILE__
main
end