From 018dcaea4fed11ce1d0b87c876b5c4c4d1bc40ae Mon Sep 17 00:00:00 2001 From: Ryan Blue Date: Mon, 28 Oct 2024 21:07:30 -0400 Subject: [PATCH] [ci] Check return code of subprocesses in pregen_all (#7307) Previously errors were ignored. Also makes the script more cross-platform by using the current python executable to run the subprocesses. --- .github/workflows/pregen_all.py | 50 ++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pregen_all.py b/.github/workflows/pregen_all.py index d7ec35af74..426ea2d5f0 100755 --- a/.github/workflows/pregen_all.py +++ b/.github/workflows/pregen_all.py @@ -16,24 +16,48 @@ def main(argv): required=True, ) args = parser.parse_args(argv) - subprocess.run(["python", f"{REPO_ROOT}/hal/generate_usage_reporting.py"]) - subprocess.run(["python", f"{REPO_ROOT}/ntcore/generate_topics.py"]) - subprocess.run(["python", f"{REPO_ROOT}/wpimath/generate_numbers.py"]) + subprocess.run( + [sys.executable, f"{REPO_ROOT}/hal/generate_usage_reporting.py"], check=True + ) + subprocess.run( + [sys.executable, f"{REPO_ROOT}/ntcore/generate_topics.py"], check=True + ) + subprocess.run( + [sys.executable, f"{REPO_ROOT}/wpimath/generate_numbers.py"], check=True + ) subprocess.run( [ - "python", + sys.executable, f"{REPO_ROOT}/wpimath/generate_quickbuf.py", f"--quickbuf_plugin={args.quickbuf_plugin}", - ] + ], + check=True, ) - subprocess.run(["python", f"{REPO_ROOT}/wpiunits/generate_units.py"]) - subprocess.run(["python", f"{REPO_ROOT}/wpilibc/generate_hids.py"]) - subprocess.run(["python", f"{REPO_ROOT}/wpilibj/generate_hids.py"]) - subprocess.run(["python", f"{REPO_ROOT}/wpilibNewCommands/generate_hids.py"]) - subprocess.run(["python", f"{REPO_ROOT}/wpilibc/generate_pwm_motor_controllers.py"]) - subprocess.run(["python", f"{REPO_ROOT}/wpilibj/generate_pwm_motor_controllers.py"]) - subprocess.run(["python", f"{REPO_ROOT}/thirdparty/imgui_suite/generate_gl3w.py"]) - subprocess.run(f"{REPO_ROOT}/thirdparty/imgui_suite/generate_fonts.sh") + subprocess.run( + [sys.executable, f"{REPO_ROOT}/wpiunits/generate_units.py"], check=True + ) + subprocess.run( + [sys.executable, f"{REPO_ROOT}/wpilibc/generate_hids.py"], check=True + ) + subprocess.run( + [sys.executable, f"{REPO_ROOT}/wpilibj/generate_hids.py"], check=True + ) + subprocess.run( + [sys.executable, f"{REPO_ROOT}/wpilibNewCommands/generate_hids.py"], check=True + ) + subprocess.run( + [sys.executable, f"{REPO_ROOT}/wpilibc/generate_pwm_motor_controllers.py"], + check=True, + ) + subprocess.run( + [sys.executable, f"{REPO_ROOT}/wpilibj/generate_pwm_motor_controllers.py"], + check=True, + ) + subprocess.run( + [sys.executable, f"{REPO_ROOT}/thirdparty/imgui_suite/generate_gl3w.py"], + check=True, + ) + subprocess.run(f"{REPO_ROOT}/thirdparty/imgui_suite/generate_fonts.sh", check=True) if __name__ == "__main__":