Validate that all modular workflow files exist and are valid.
(self)
| 164 | return False |
| 165 | |
| 166 | def _validate_modular_workflows(self) -> bool: |
| 167 | """Validate that all modular workflow files exist and are valid.""" |
| 168 | try: |
| 169 | required_workflows = ["01-validation.yml", "02-testing.yml", "03-build.yml", "04-release.yml", "05-deployment.yml", "pipeline-orchestrator.yml"] |
| 170 | |
| 171 | missing_files = [] |
| 172 | invalid_files = [] |
| 173 | |
| 174 | for workflow_file in required_workflows: |
| 175 | workflow_path = self.workflows_dir / workflow_file |
| 176 | |
| 177 | if not workflow_path.exists(): |
| 178 | missing_files.append(workflow_file) |
| 179 | continue |
| 180 | |
| 181 | # Validate YAML syntax |
| 182 | try: |
| 183 | with open(workflow_path, "r", encoding="utf-8") as f: |
| 184 | yaml.safe_load(f) |
| 185 | print(f" [PASS] {workflow_file} - Valid YAML") |
| 186 | except yaml.YAMLError as e: |
| 187 | invalid_files.append(f"{workflow_file}: {str(e)}") |
| 188 | print(f" [FAIL] {workflow_file} - Invalid YAML: {e}") |
| 189 | |
| 190 | if missing_files: |
| 191 | self.steps[1].error = f"Missing workflow files: {missing_files}" |
| 192 | return False |
| 193 | |
| 194 | if invalid_files: |
| 195 | self.steps[1].error = f"Invalid workflow files: {invalid_files}" |
| 196 | return False |
| 197 | |
| 198 | print(f" [PASS] All {len(required_workflows)} modular workflows validated") |
| 199 | return True |
| 200 | |
| 201 | except Exception as e: |
| 202 | self.steps[1].error = str(e) |
| 203 | return False |
| 204 | |
| 205 | def _check_script_dependencies(self) -> bool: |
| 206 | """Check that all required scripts exist and are functional.""" |