4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 02:24:38 +08:00
nerfstudio/scripts/debugging/run_actions.py
evonneng 5433f831ac
add licensing headers (#27)
* add licensing headers

* add licensing to run actions

* rerun headers file

* remove trailing white spaces
2022-06-08 13:31:13 -07:00

30 lines
929 B
Python

"""Simple yaml debugger"""
import subprocess
import yaml
LOCAL_TESTS = ["Run Black", "Python Pylint", "Test with pytest"]
if __name__ == "__main__":
with open(".github/workflows/code_checks.yml", "rb") as f:
my_dict = yaml.safe_load(f)
steps = my_dict["jobs"]["build"]["steps"]
for step in steps:
if "name" in step and step["name"] in LOCAL_TESTS:
compressed = step["run"].replace("\n", ";").replace("\\", "")
curr_command = f"{compressed}"
print("*" * 100)
print(f"Running {curr_command}")
subprocess.call(curr_command, shell=True)
else:
print("*" * 100)
print(f"Skipping {step}")
# Add checks for building documentation
subprocess.call("cd docs/; make html; cd ../", shell=True)
# Add licensing to all pyrad files
subprocess.call("./scripts/licensing/license_headers.sh", shell=True)