-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2dcd2f
commit ed7c294
Showing
3 changed files
with
44 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env python3 | ||
"""Script to create JSON array useful for a github action matrix.""" | ||
import glob | ||
import json | ||
import os | ||
|
||
|
||
ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__), "..")) | ||
EXAMPLES = os.path.join(ROOT, "examples") | ||
|
||
|
||
def get_examples(): | ||
"""The current list of examples, determined from the directories on disk""" | ||
return [ | ||
os.path.basename(os.path.normpath(file)) for file in glob.glob(f"{EXAMPLES}/*") | ||
] | ||
|
||
|
||
if __name__ == "__main__": | ||
# no spaces between elements are allowed for using array in bash | ||
print(json.dumps(get_examples(), separators=(',', ':'))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters