Skip to content

Commit d8f0d51

Browse files
committed
fix(#268): group runners
1 parent fe05904 commit d8f0d51

2 files changed

Lines changed: 29 additions & 24 deletions

File tree

sr-data/src/sr_data/steps/workflows.py

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -84,30 +84,34 @@ def workflow_info(content):
8484
scount = 0
8585
for job, jdetails in jobs:
8686
runs = jdetails.get("runs-on")
87-
if runs is not None and runs.startswith("$"):
88-
matrix = jdetails.get("strategy").get("matrix")
89-
keys = [
90-
key.strip() for key in
91-
runs.strip().replace("${{", "").replace("}}", "")
92-
.split(".")[1:]
93-
]
94-
if len(keys) == 1:
95-
if matrix.get(keys[0]):
96-
for matrixed in matrix.get(keys[0]):
97-
oss.append(matrixed)
98-
elif len(keys) > 1:
99-
for system in dot_values(keys, matrix):
100-
oss.append(system)
101-
elif matrix.get("include"):
102-
for include in matrix.get("include"):
103-
oss.append(
104-
include.get(
105-
runs.strip()
106-
.replace("${{", "")
107-
.replace("}}", "")
108-
.split(".")[1].strip()
87+
if runs is not None and not isinstance(runs, dict):
88+
if runs.startswith("$"):
89+
matrix = jdetails.get("strategy").get("matrix")
90+
keys = [
91+
key.strip() for key in
92+
runs.strip().replace("${{", "").replace("}}", "")
93+
.split(".")[1:]
94+
]
95+
if len(keys) == 1:
96+
if matrix.get(keys[0]):
97+
for matrixed in matrix.get(keys[0]):
98+
oss.append(matrixed)
99+
elif len(keys) > 1:
100+
for system in dot_values(keys, matrix):
101+
oss.append(system)
102+
elif matrix.get("include"):
103+
for include in matrix.get("include"):
104+
oss.append(
105+
include.get(
106+
runs.strip()
107+
.replace("${{", "")
108+
.replace("}}", "")
109+
.split(".")[1].strip()
110+
)
109111
)
110-
)
112+
elif isinstance(runs, dict):
113+
if runs.get("group"):
114+
oss.append(runs.get("group"))
111115
elif runs is not None:
112116
oss.append(runs)
113117
steps = jdetails.get("steps")

sr-data/src/tests/resources/to-workflows.csv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ gordnzhou/imnes-emulator,main,
1010
lanylow/honkai-dumper,main,
1111
BillyDM/vitalium-verb,main,"build.yml"
1212
polespinasa/bitcoin-grouphug,main,"ci.yml"
13-
rohaquinlop/complexipy/,main,"CI.yml"
13+
rohaquinlop/complexipy,main,"CI.yml"
14+
zkVerify/zkVerify,main,"CI-build-test-publish.yml,CI-build.yml,CI-cache-manager.yml,CI-coverage.yml,CI-lint-format.yml,CI-orchestrator.yml,CI-rustdoc.yml,CI-tag-orchestrator.yml,CI-test.yml,CI-zombienet-test.yml"

0 commit comments

Comments
 (0)