|
13 | 13 | from localci.core.github_token import resolve_github_token, warn_sentinel_github_token |
14 | 14 | from localci.core.models import JobEvent, JobEventType |
15 | 15 | from localci.core.results import ExecutionSummary |
16 | | -from localci.core.workflow import MatrixEntry, Platform, Workflow |
| 16 | +from localci.core.workflow import PLATFORM_CLI_MAP, MatrixEntry, Workflow |
17 | 17 | from localci.errors import ActNotFoundError, DockerNotAvailableError, WorkflowError |
18 | 18 | from localci.utils.output import print_error, print_info, print_warning |
19 | | - |
20 | | -_PLATFORM_MAP = { |
21 | | - "linux": Platform.LINUX, |
22 | | - "windows": Platform.WINDOWS, |
23 | | - "macos": Platform.MACOS, |
24 | | -} |
| 19 | +from localci.utils.paths import REGISTRY_FILENAME, find_file_upward |
25 | 20 |
|
26 | 21 |
|
27 | 22 | def execute_run( |
@@ -73,13 +68,10 @@ def execute_run( |
73 | 68 | return 0 |
74 | 69 |
|
75 | 70 | priority_config = container.priority_config_factory(cfg) |
76 | | - registry_candidate = project_dir / "image-registry.yml" |
77 | | - registry_path: Path | None = ( |
78 | | - registry_candidate if registry_candidate.exists() else None |
79 | | - ) |
| 71 | + registry_path = find_file_upward(REGISTRY_FILENAME, project_dir) |
80 | 72 |
|
81 | 73 | matrix_include, matrix_exclude = _resolve_matrix_filters(options, cfg) |
82 | | - plat_filter = _PLATFORM_MAP.get(options.platform) if options.platform else None |
| 74 | + plat_filter = PLATFORM_CLI_MAP.get(options.platform) if options.platform else None |
83 | 75 | compiler_filter = options.compiler.lower() if options.compiler else None |
84 | 76 | selected_set = {(jid, e.index) for jid, e in selected} |
85 | 77 | job_filter_list = list({jid for jid, _ in selected}) |
@@ -197,7 +189,7 @@ def _filter_matrix_pairs( |
197 | 189 | ) -> list[tuple[str, MatrixEntry]]: |
198 | 190 | selected = list(all_pairs) |
199 | 191 | if platform: |
200 | | - target_plat = _PLATFORM_MAP.get(platform) |
| 192 | + target_plat = PLATFORM_CLI_MAP.get(platform) |
201 | 193 | selected = [(jid, e) for jid, e in selected if e.platform == target_plat] |
202 | 194 |
|
203 | 195 | compiler_filter = compiler.lower() if compiler else None |
|
0 commit comments