mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'ci/run_build_test_check_when_soc_updated' into 'master'
CI: run build test check when soc caps updated See merge request espressif/esp-idf!19940
This commit is contained in:
commit
24c31bd7fb
@ -30,6 +30,7 @@ USUAL_TO_FORMAL = {
|
|||||||
'esp32c3': 'ESP32-C3',
|
'esp32c3': 'ESP32-C3',
|
||||||
'esp32h2': 'ESP32-H2',
|
'esp32h2': 'ESP32-H2',
|
||||||
'esp32c2': 'ESP32-C2',
|
'esp32c2': 'ESP32-C2',
|
||||||
|
'esp32c6': 'ESP32-C6',
|
||||||
'linux': 'Linux',
|
'linux': 'Linux',
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,6 +41,7 @@ FORMAL_TO_USUAL = {
|
|||||||
'ESP32-C3': 'esp32c3',
|
'ESP32-C3': 'esp32c3',
|
||||||
'ESP32-H2': 'esp32h2',
|
'ESP32-H2': 'esp32h2',
|
||||||
'ESP32-C2': 'esp32c2',
|
'ESP32-C2': 'esp32c2',
|
||||||
|
'ESP32-C6': 'esp32c6',
|
||||||
'Linux': 'linux',
|
'Linux': 'linux',
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +53,7 @@ def doublequote(s: str) -> str:
|
|||||||
return f'"{s}"'
|
return f'"{s}"'
|
||||||
|
|
||||||
|
|
||||||
def check_readme(paths: List[str]) -> None:
|
def check_readme(paths: List[str], exclude_dirs: Optional[List[str]] = None) -> None:
|
||||||
from idf_build_apps import App, find_apps
|
from idf_build_apps import App, find_apps
|
||||||
from idf_build_apps.constants import SUPPORTED_TARGETS
|
from idf_build_apps.constants import SUPPORTED_TARGETS
|
||||||
|
|
||||||
@ -136,6 +138,7 @@ def check_readme(paths: List[str]) -> None:
|
|||||||
paths,
|
paths,
|
||||||
'all',
|
'all',
|
||||||
recursive=True,
|
recursive=True,
|
||||||
|
exclude_list=exclude_dirs or [],
|
||||||
manifest_files=[
|
manifest_files=[
|
||||||
str(p) for p in Path(IDF_PATH).glob('**/.build-test-rules.yml')
|
str(p) for p in Path(IDF_PATH).glob('**/.build-test-rules.yml')
|
||||||
],
|
],
|
||||||
@ -196,7 +199,7 @@ def check_readme(paths: List[str]) -> None:
|
|||||||
sys.exit(exit_code)
|
sys.exit(exit_code)
|
||||||
|
|
||||||
|
|
||||||
def check_test_scripts(paths: List[str]) -> None:
|
def check_test_scripts(paths: List[str], exclude_dirs: Optional[List[str]] = None) -> None:
|
||||||
from idf_build_apps import App, find_apps
|
from idf_build_apps import App, find_apps
|
||||||
|
|
||||||
# takes long time, run only in CI
|
# takes long time, run only in CI
|
||||||
@ -303,6 +306,7 @@ def check_test_scripts(paths: List[str]) -> None:
|
|||||||
paths,
|
paths,
|
||||||
'all',
|
'all',
|
||||||
recursive=True,
|
recursive=True,
|
||||||
|
exclude_list=exclude_dirs or [],
|
||||||
manifest_files=[
|
manifest_files=[
|
||||||
str(p) for p in Path(IDF_PATH).glob('**/.build-test-rules.yml')
|
str(p) for p in Path(IDF_PATH).glob('**/.build-test-rules.yml')
|
||||||
],
|
],
|
||||||
@ -413,13 +417,27 @@ if __name__ == '__main__':
|
|||||||
sort_yaml(arg.files)
|
sort_yaml(arg.files)
|
||||||
else:
|
else:
|
||||||
check_dirs = set()
|
check_dirs = set()
|
||||||
for path in arg.paths:
|
|
||||||
if os.path.isfile(path):
|
# check if *_caps.h files changed
|
||||||
check_dirs.add(os.path.dirname(path))
|
check_all = False
|
||||||
|
soc_caps_header_files = list((Path(IDF_PATH) / 'components' / 'soc').glob('**/*_caps.h'))
|
||||||
|
for p in arg.paths:
|
||||||
|
if Path(p).resolve() in soc_caps_header_files:
|
||||||
|
check_all = True
|
||||||
|
break
|
||||||
|
|
||||||
|
if os.path.isfile(p):
|
||||||
|
check_dirs.add(os.path.dirname(p))
|
||||||
else:
|
else:
|
||||||
check_dirs.add(path)
|
check_dirs.add(p)
|
||||||
|
|
||||||
|
if check_all:
|
||||||
|
check_dirs = {IDF_PATH}
|
||||||
|
_exclude_dirs = [os.path.join(IDF_PATH, 'tools', 'unit-test-app')]
|
||||||
|
else:
|
||||||
|
_exclude_dirs = []
|
||||||
|
|
||||||
if arg.action == 'check-readmes':
|
if arg.action == 'check-readmes':
|
||||||
check_readme(list(check_dirs))
|
check_readme(list(check_dirs), _exclude_dirs)
|
||||||
elif arg.action == 'check-test-scripts':
|
elif arg.action == 'check-test-scripts':
|
||||||
check_test_scripts(list(check_dirs))
|
check_test_scripts(list(check_dirs), _exclude_dirs)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user