ci: make CUDA conditional lane GPU-capable

This commit is contained in:
Joseph Magly
2026-08-16 09:23:22 -04:00
parent baf5331730
commit fa233fd8c9
4 changed files with 42 additions and 5 deletions
+12
View File
@@ -37,6 +37,18 @@ def test_committed_conditional_policy_is_complete():
) == []
def test_cuda_job_replaces_locked_cpu_torch_with_same_version_cuda_build():
workflow = (ROOT / ".github" / "workflows" / "conditional-tests.yml").read_text()
cuda_job = workflow.split(" cuda:\n", maxsplit=1)[1].split(" mps:\n", maxsplit=1)[0]
assert "torch.__version__.split" in cuda_job
assert "UV_TORCH_BACKEND=cu130 uv pip install" in cuda_job
assert "--reinstall-package torch" in cuda_job
assert '"torch==$CUDA_TORCH_VERSION"' in cuda_job
assert "assert torch.version.cuda is not None" in cuda_job
assert 'uv pip check --python "$CONDITIONAL_ENV/bin/python"' in cuda_job
def test_policy_rejects_unknown_cpu_exclusion_gate(tmp_path):
policy = json.loads((ROOT / "ci" / "conditional-test-policy.json").read_text())
quality = {