forked from espressif/esp-thread-br
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprecommit_version_check.py
More file actions
executable file
·27 lines (24 loc) · 1.21 KB
/
precommit_version_check.py
File metadata and controls
executable file
·27 lines (24 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import sys
import tools.ci.version_check_tools as vct
component_list = ["esp_ot_cli_extension", "esp_rcp_update"]
example_list = ["basic_thread_border_router"]
for component_name in component_list:
print(f"Checking {component_name}")
main_version = vct.get_component_version_from_git(component_name, "origin/main")
current_version = vct.get_component_version_from_git(component_name)
if not main_version or not current_version:
sys.exit(1)
if not vct.check_version_increment(main_version, current_version, True):
sys.exit(1)
for example_name in example_list:
yaml_path = vct.get_path_of_yaml(example_name)
example_version = vct.get_example_component_version_from_git(component_name, example_name)
if not example_version:
sys.exit(1)
example_version_process = vct.process_version(example_version)
if not example_version_process:
sys.exit(1)
if not vct.check_version_increment(example_version_process, current_version, False):
print(f"{component_name} version of {example_name} is invalid, use {example_version}, latest is {current_version}")
sys.exit(1)
print("Version check passed successfully.")