Skip to content

Commit 4a12c6e

Browse files
authored
ci: fix build matrix (#5664)
1 parent d58ee4e commit 4a12c6e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/scripts/matrices.py

100644100755
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import json
24
import os
35

@@ -88,12 +90,10 @@ def __init__(self, os: str, target: str, name: str, flags: str, partition: int):
8890

8991

9092
def build_matrix():
91-
os_ids = []
92-
targets_ = []
93+
expanded = []
9394
for target in targets:
94-
os_ids.append(target.os_id)
95-
targets_.append(target.target)
96-
print(json.dumps({"os": os_ids, "target": targets_}))
95+
expanded.append({"os": target.os_id, "target": target.target})
96+
print_json({"include": expanded})
9797

9898

9999
def test_matrix():
@@ -125,7 +125,11 @@ def test_matrix():
125125
)
126126
expanded.append(vars(obj))
127127

128-
print(json.dumps({"include": expanded}), end="", flush=True)
128+
print_json({"include": expanded})
129+
130+
131+
def print_json(obj):
132+
print(json.dumps(obj), end="", flush=True)
129133

130134

131135
if __name__ == "__main__":

0 commit comments

Comments
 (0)