From ae7643975d87e124cc908efcdf114eb1bcdcfcaf Mon Sep 17 00:00:00 2001 From: Jason <83615043+JJassonn69@users.noreply.github.com> Date: Thu, 16 Apr 2026 10:27:58 +0545 Subject: [PATCH] fix(ci): fail hard when required tools missing in CI Silently skipping Tier 2/3 tests in CI defeats the purpose of running them. Add a GITHUB_ACTIONS guard that raises RuntimeError at module load if iverilog or C++ compiler is not found, preventing false-green CI results from skipped tests. --- .../tests/cross_layer/test_cross_layer_contract.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/9_Firmware/tests/cross_layer/test_cross_layer_contract.py b/9_Firmware/tests/cross_layer/test_cross_layer_contract.py index b24d2a3..6d103de 100644 --- a/9_Firmware/tests/cross_layer/test_cross_layer_contract.py +++ b/9_Firmware/tests/cross_layer/test_cross_layer_contract.py @@ -61,6 +61,20 @@ _has_cxx = subprocess.run( [CXX, "--version"], capture_output=True ).returncode == 0 +# In CI, missing tools must be a hard failure — never silently skip. +_in_ci = os.environ.get("GITHUB_ACTIONS") == "true" +if _in_ci: + if not _has_iverilog: + raise RuntimeError( + "iverilog is required in CI but was not found. " + "Ensure 'apt-get install iverilog' ran and IVERILOG/VVP are on PATH." + ) + if not _has_cxx: + raise RuntimeError( + "C++ compiler is required in CI but was not found. " + "Ensure build-essential is installed." + ) + def _parse_hex_results(text: str) -> list[dict[str, str]]: """Parse space-separated hex lines from TB output files."""