Skip to content

Commit 5af4f6d

Browse files
[ci] Apply recent CI infrastructure improvements
1 parent e81a385 commit 5af4f6d

File tree

7 files changed

+230
-226
lines changed

7 files changed

+230
-226
lines changed

.github/scripts/build-matrix.rb

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
require "json"
2+
require "optparse"
3+
4+
BASE_MATRIX_ENTRIES = [
5+
{
6+
"build_os": "ubuntu-18.04",
7+
"agent_query": "ubuntu-18.04",
8+
"target": "ubuntu18.04_x86_64",
9+
"container": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-18.04",
10+
"run_stdlib_test": true,
11+
"run_full_test": false,
12+
"run_e2e_test": true,
13+
"build_hello_wasm": true,
14+
"clean_build_dir": false,
15+
"free_disk_space": true
16+
},
17+
{
18+
"build_os": "ubuntu-20.04",
19+
"agent_query": "ubuntu-20.04",
20+
"target": "ubuntu20.04_x86_64",
21+
"container": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-20.04",
22+
"run_stdlib_test": true,
23+
"run_full_test": false,
24+
"run_e2e_test": true,
25+
"build_hello_wasm": true,
26+
"clean_build_dir": false,
27+
"free_disk_space": true
28+
},
29+
{
30+
"build_os": "ubuntu-22.04",
31+
"agent_query": "ubuntu-22.04",
32+
"target": "ubuntu22.04_x86_64",
33+
"container": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-22.04",
34+
"run_stdlib_test": true,
35+
"run_full_test": false,
36+
"run_e2e_test": true,
37+
"build_hello_wasm": true,
38+
"clean_build_dir": false,
39+
"free_disk_space": true
40+
},
41+
{
42+
"build_os": "amazon-linux-2",
43+
"agent_query": "ubuntu-22.04",
44+
"target": "amazonlinux2_x86_64",
45+
"container": "ghcr.io/swiftwasm/swift-ci:main-amazon-linux-2",
46+
"run_stdlib_test": false,
47+
"run_full_test": false,
48+
"run_e2e_test": false,
49+
"build_hello_wasm": true,
50+
"clean_build_dir": false,
51+
"free_disk_space": true
52+
},
53+
{
54+
"build_os": "macos-11",
55+
"agent_query": "macos-11",
56+
"target": "macos_x86_64",
57+
"run_stdlib_test": false,
58+
"run_full_test": false,
59+
"run_e2e_test": false,
60+
"build_hello_wasm": false,
61+
"clean_build_dir": false
62+
},
63+
{
64+
"build_os": "macos-11",
65+
"agent_query": ["self-hosted", "macOS", "ARM64"],
66+
"target": "macos_arm64",
67+
"run_stdlib_test": false,
68+
"run_full_test": false,
69+
"run_e2e_test": false,
70+
"build_hello_wasm": true,
71+
"clean_build_dir": true
72+
}
73+
]
74+
75+
def main
76+
options = {}
77+
OptionParser.new do |opts|
78+
opts.banner = "Usage: build-matrix.rb [options]"
79+
opts.on("--runner [JSON FILE]", "Path to runner data file") do |v|
80+
options[:runner] = v
81+
end
82+
end.parse!
83+
84+
matrix_entries = BASE_MATRIX_ENTRIES.dup
85+
if options[:runner]
86+
runner = JSON.parse(File.read(options[:runner]))
87+
if label = runner["outputs"]["ubuntu20_04_aarch64-label"]
88+
matrix_entries << {
89+
"build_os": "ubuntu-20.04",
90+
"agent_query": label,
91+
"target": "ubuntu20.04_aarch64",
92+
"container": "ghcr.io/swiftwasm/swift-ci:main-ubuntu-20.04",
93+
"run_stdlib_test": false,
94+
"run_full_test": false,
95+
"run_e2e_test": false,
96+
"build_hello_wasm": true,
97+
"clean_build_dir": false
98+
}
99+
end
100+
end
101+
102+
print JSON.generate(matrix_entries)
103+
end
104+
105+
if $0 == __FILE__
106+
main
107+
end

0 commit comments

Comments
 (0)