Skip to content

Commit

Permalink
better
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros-k committed May 10, 2024
1 parent 2c3ecf3 commit 7cecfc8
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions .github/scripts/changed_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
# Print to stderr, in order to keep stdout only for data
print(f"Changed files: {changed_files}", file=sys.stderr)

seen = set()
matrix = []
tracker = {}
for file in changed_files:
match = APP_REGEX.match(file)
if not match:
Expand All @@ -40,19 +40,21 @@
full_name,
TEST_VALUES_DIR,
).glob("*.yaml"):
matrix.append(
{
"train": match.group(1),
"app": match.group(2),
"test_file": file.name,
}
)
print(
f"Detected changed item for {full_name}: {json.dumps(matrix[-1], indent=2)}",
file=sys.stderr,
)
item_tuple = (match.group(1), match.group(2), file.name)
if item_tuple not in seen:
seen.add(item_tuple)
matrix.append(
{
"train": match.group(1),
"app": match.group(2),
"test_file": file.name,
}
)
print(
f"Detected changed item for {full_name}: {json.dumps(matrix[-1], indent=2)}",
file=sys.stderr,
)

matrix = set(matrix)
print(json.dumps({"include": matrix}))
# This should look like:
# {
Expand Down

0 comments on commit 7cecfc8

Please sign in to comment.