Skip to content

Commit 03c7a10

Browse files
committed
ci(build): Recompile everything on libs change
1 parent d55b743 commit 03c7a10

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/scripts/get_affected.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@
112112
# A list of files that are used by the CI and build system.
113113
# If any of these files change, the preset sketches should be recompiled.
114114
build_files = [
115-
"package/package_esp32_index.template.json",
116115
"package.json",
117116
"tools/get.py",
118117
"tools/get.exe",
@@ -547,6 +546,17 @@ def preprocess_changed_files(changed_files: list[str]) -> None:
547546
"""
548547
Preprocess the changed files to detect build system changes.
549548
"""
549+
# Special case: if the Arduino libs or tools changes, rebuild all sketches on PRs
550+
if is_pr and not component_mode:
551+
for changed in changed_files:
552+
if changed == "package/package_esp32_index.template.json":
553+
print("Package index changed - all sketches affected", file=sys.stderr)
554+
all_sketches = list_ino_files()
555+
for sketch in all_sketches:
556+
if sketch not in affected_sketches:
557+
affected_sketches.append(sketch)
558+
# No need to continue preprocessing; dependency walk will still run afterwards
559+
break
550560
# If not a PR, skip preprocessing as we'll recompile everything anyway
551561
if not is_pr:
552562
return

0 commit comments

Comments
 (0)