mirror of
https://github.com/esphome/esphome.git
synced 2026-01-10 12:10:48 -07:00
[ci] Skip memory impact analysis when more than 40 components changed (#11741)
This commit is contained in:
@@ -94,6 +94,7 @@ class Platform(StrEnum):
|
||||
# Memory impact analysis constants
|
||||
MEMORY_IMPACT_FALLBACK_COMPONENT = "api" # Representative component for core changes
|
||||
MEMORY_IMPACT_FALLBACK_PLATFORM = Platform.ESP32_IDF # Most representative platform
|
||||
MEMORY_IMPACT_MAX_COMPONENTS = 40 # Max components before results become nonsensical
|
||||
|
||||
# Platform-specific components that can only be built on their respective platforms
|
||||
# These components contain platform-specific code and cannot be cross-compiled
|
||||
@@ -555,6 +556,17 @@ def detect_memory_impact_config(
|
||||
if not components_with_tests:
|
||||
return {"should_run": "false"}
|
||||
|
||||
# Skip memory impact analysis if too many components changed
|
||||
# Building 40+ components at once produces nonsensical memory impact results
|
||||
# This typically happens with large refactorings or batch updates
|
||||
if len(components_with_tests) > MEMORY_IMPACT_MAX_COMPONENTS:
|
||||
print(
|
||||
f"Memory impact: Skipping analysis for {len(components_with_tests)} components "
|
||||
f"(limit is {MEMORY_IMPACT_MAX_COMPONENTS}, would give nonsensical results)",
|
||||
file=sys.stderr,
|
||||
)
|
||||
return {"should_run": "false"}
|
||||
|
||||
# Find common platforms supported by ALL components
|
||||
# This ensures we can build all components together in a merged config
|
||||
common_platforms = set(MEMORY_IMPACT_PLATFORM_PREFERENCE)
|
||||
|
||||
Reference in New Issue
Block a user