from pathlib import Path import yaml WORKFLOWS = Path(__file__).resolve().parents[1] / ".gitea" / "workflows" def test_workflows_do_not_deploy_to_center(): assert not (WORKFLOWS / "deploy-customer-main.yml").exists() for path in WORKFLOWS.glob("*.y*ml"): workflow = yaml.safe_load(path.read_text()) assert "deploy_customer_main" not in workflow["jobs"] content = path.read_text() for forbidden in ("CUSTOMER_DEPLOY_", "10.0.10.174", "/ecos/release-service"): assert forbidden not in content, (path.name, forbidden) def test_ci_does_not_prune_shared_runner_resources(): for path in WORKFLOWS.glob("*.y*ml"): content = path.read_text() for command in ( "docker system prune", "docker builder prune", "docker buildx prune", ): assert command not in content, (path.name, command)