diff --git a/esphome/build_helpers/pch.py b/esphome/build_helpers/pch.py index 25dc9a7ae1..dc23942c8e 100644 --- a/esphome/build_helpers/pch.py +++ b/esphome/build_helpers/pch.py @@ -13,7 +13,6 @@ import re from esphome.build_helpers.ccache import effective_ccache_basedir, parse_enable_env from esphome.const import ( PLATFORM_BK72XX, - PLATFORM_ESP32, PLATFORM_LN882X, PLATFORM_NRF52, PLATFORM_RTL87XX, @@ -50,7 +49,6 @@ PCH_DEFAULT_HEADERS = ("esphome/core/pch_prefix.h",) PCH_SCRIPT_EXCLUDED_PLATFORMS = frozenset( { PLATFORM_BK72XX, - PLATFORM_ESP32, PLATFORM_LN882X, PLATFORM_NRF52, PLATFORM_RTL87XX, diff --git a/script/determine-jobs.py b/script/determine-jobs.py index 3f0143076b..e3a0ff688f 100755 --- a/script/determine-jobs.py +++ b/script/determine-jobs.py @@ -546,10 +546,6 @@ ESP32_PLATFORMIO_TRIGGER_PATH_PREFIXES = ( *_SMOKE_HARNESS_TRIGGER_PATH_PREFIXES, ) -# Standalone files that, when changed, trigger the PlatformIO compile test: -# - esphome/build_gen/platformio.py -- the PlatformIO build generator -# - script/test_build_components.py -- the harness the job invokes -# - .github/workflows/ci.yml -- the job's own definition # Shared by every toolchain smoke-test job: the harness it invokes and the # workflow that defines it _SMOKE_HARNESS_TRIGGER_FILES = frozenset( @@ -559,8 +555,14 @@ _SMOKE_HARNESS_TRIGGER_FILES = frozenset( } ) +# Standalone files that, when changed, trigger the PlatformIO compile test ESP32_PLATFORMIO_TRIGGER_FILES = _SMOKE_HARNESS_TRIGGER_FILES | { + # The PlatformIO build generator "esphome/build_gen/platformio.py", + # Decides which platforms take the pch script in esphome/platformio/, + # and the module that parses its switch and the ccache settings + "esphome/build_helpers/pch.py", + "esphome/build_helpers/ccache.py", } diff --git a/tests/script/test_determine_jobs.py b/tests/script/test_determine_jobs.py index c3f30b8ed1..49f101d679 100644 --- a/tests/script/test_determine_jobs.py +++ b/tests/script/test_determine_jobs.py @@ -1089,6 +1089,9 @@ _ESP32_PLATFORMIO_FULL_LIST_FILES = [ # PlatformIO subsystem (path-prefix trigger) + build generator ["esphome/platformio/runner.py"], ["esphome/platformio/toolchain.py"], + # Decides which platforms take the pch script + ["esphome/build_helpers/pch.py"], + ["esphome/build_helpers/ccache.py"], ["esphome/build_gen/platformio.py"], # Workflow / harness files ["script/test_build_components.py"], @@ -1150,6 +1153,9 @@ def test_esp32_platformio_components_to_test_returns_full_list_on_infrastructure # Non-PlatformIO files in esphome/build_gen/ do NOT trigger the # full list -- only esphome/build_gen/platformio.py is a trigger. (["esphome/build_gen/espidf.py"], [], []), + # The rest of build_helpers/ is not a trigger. + (["esphome/build_helpers/size_summary.py"], [], []), + (["esphome/build_helpers/ninja.py"], [], []), # Docs / unrelated files -> empty. (["README.md"], [], []), ([], [], []), diff --git a/tests/unit_tests/build_helpers/test_pch.py b/tests/unit_tests/build_helpers/test_pch.py index 9ebcbe604b..a64e9525e6 100644 --- a/tests/unit_tests/build_helpers/test_pch.py +++ b/tests/unit_tests/build_helpers/test_pch.py @@ -109,7 +109,7 @@ def test_pch_checksum_tracks_closure_content(tmp_path: Path) -> None: assert base != pch.pch_checksum(tmp_path, ["root.h"], ["id"]) -@pytest.mark.parametrize("platform", ["esp8266", "rp2"]) +@pytest.mark.parametrize("platform", ["esp32", "esp8266", "rp2"]) def test_pch_script_enabled(platform: str, monkeypatch: pytest.MonkeyPatch) -> None: CORE.data[KEY_CORE] = {KEY_TARGET_PLATFORM: platform} assert pch.pch_script_enabled()