Skip to content

Commit 65e239d

Browse files
authored
[action] yml file adds the depends parameter (#9627)
1 parent ea75800 commit 65e239d

File tree

2 files changed

+122
-14
lines changed

2 files changed

+122
-14
lines changed

bsp/nrf5x/nrf52840/.ci/attachconfig/ci.attachconfig.yml

Lines changed: 72 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
devices.strict:
2+
depend_scons_arg:
3+
- '--strict'
14
devices.gpio:
5+
depends:
6+
- devices.strict
27
kconfig:
38
- CONFIG_BSP_USING_GPIO=y
4-
scons_arg:
5-
- '--strict'
69
devices.adc:
710
kconfig:
811
- CONFIG_BSP_USING_SAADC=y
@@ -12,13 +15,14 @@ devices.flash:
1215
devices.i2c:
1316
kconfig:
1417
- CONFIG_BSP_USING_I2C=y
15-
devices.spi:
18+
devices.spi:
1619
kconfig:
17-
- CONFIG_BSP_USING_SPI=y
18-
devices.uart:
20+
- CONFIG_RT_USING_SPI=y
21+
- CONFIG_BSP_USING_SPI=y
22+
devices.uart:
1923
kconfig:
2024
- CONFIG_BSP_USING_UART=y
21-
devices.watchdog:
25+
devices.watchdog:
2226
kconfig:
2327
- CONFIG_BSP_USING_WDT=y
2428
devices.qspi_flash:
@@ -33,4 +37,65 @@ devices.rtc:
3337
devices.hwtimer:
3438
kconfig:
3539
- CONFIG_BSP_USING_TIM=y
36-
- CONFIG_BSP_USING_TIM0=y
40+
- CONFIG_BSP_USING_TIM0=y
41+
# ------ NimBLE-v1.0.0 CI ------
42+
nimble:
43+
kconfig:
44+
- CONFIG_BSP_USING_NIMBLE=y
45+
- CONFIG_PKG_USING_NIMBLE_V100=y
46+
nimble.advertiser:
47+
depends:
48+
- nimble
49+
kconfig:
50+
- CONFIG_PKG_NIMBLE_SAMPLE_ADVERTISER=y
51+
nimble.beacon:
52+
depends:
53+
- nimble
54+
kconfig:
55+
- CONFIG_PKG_NIMBLE_SAMPLE_BEACON=y
56+
nimble.blecsc:
57+
depends:
58+
- nimble
59+
kconfig:
60+
- CONFIG_PKG_NIMBLE_SAMPLE_BLECSC=y
61+
nimble.central:
62+
depends:
63+
- nimble
64+
kconfig:
65+
- CONFIG_PKG_NIMBLE_SAMPLE_CENTRAL=y
66+
nimble.ext.advertiser:
67+
depends:
68+
- nimble
69+
kconfig:
70+
- CONFIG_PKG_NIMBLE_SAMPLE_EXT_ADVERTISER=y
71+
- CONFIG_PKG_NIMBLE_EXT_ADV=y
72+
nimble.mesh:
73+
depends:
74+
- nimble
75+
kconfig:
76+
- CONFIG_PKG_NIMBLE_SAMPLE_BLEMESH=y
77+
nimble.per.hr:
78+
depends:
79+
- nimble
80+
kconfig:
81+
- CONFIG_PKG_NIMBLE_SAMPLE_PER_HR=y
82+
nimble.peripheral:
83+
depends:
84+
- nimble
85+
kconfig:
86+
- CONFIG_PKG_NIMBLE_SAMPLE_PERIPHERAL=y
87+
nimble.btshell:
88+
depends:
89+
- nimble
90+
kconfig:
91+
- CONFIG_PKG_NIMBLE_SAMPLE_BTSHELL=y
92+
nimble.uart:
93+
depends:
94+
- nimble
95+
kconfig:
96+
- CONFIG_PKG_NIMBLE_SAMPLE_BLEUART=y
97+
# ------ SEGGER CI ------
98+
segger:
99+
kconfig:
100+
- CONFIG_PKG_USING_SEGGER_RTT=y
101+
- CONFIG_RT_USING_SERIAL_V2=y

tools/ci/bsp_buildings.py

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,32 @@ def check_scons_args(file_path):
100100
args.append(match.group(1).strip())
101101
return ' '.join(args)
102102

103+
def get_details_and_dependencies(details, projects, seen=None):
104+
if seen is None:
105+
seen = set()
106+
detail_list = []
107+
scons_arg_list = []
108+
if details is not None:
109+
for dep in details:
110+
if dep not in seen:
111+
dep_details=projects.get(dep)
112+
seen.add(dep)
113+
if dep_details is not None:
114+
if dep_details.get('depends') is not None:
115+
detail_temp,scons_arg_temp=get_details_and_dependencies(dep_details.get('depends'), projects, seen)
116+
for line in detail_temp:
117+
detail_list.append(line)
118+
for line in scons_arg_temp:
119+
scons_arg_list.append(line)
120+
if dep_details.get('kconfig') is not None:
121+
for line in dep_details.get('kconfig'):
122+
detail_list.append(line)
123+
if dep_details.get('depend_scons_arg') is not None:
124+
for line in dep_details.get('depend_scons_arg'):
125+
scons_arg_list.append(line)
126+
else:
127+
print(f"::error::There are some problems with attachconfig depend: {dep}");
128+
return detail_list,scons_arg_list
103129

104130
def build_bsp_attachconfig(bsp, attach_file):
105131
"""
@@ -167,9 +193,18 @@ def build_bsp_attachconfig(bsp, attach_file):
167193
if filename.endswith('attachconfig.yml'):
168194
file_path = os.path.join(root, filename)
169195
if os.path.exists(file_path):
170-
with open(file_path, 'r') as file:
171-
content = yaml.safe_load(file)
172-
yml_files_content.append(content)
196+
try:
197+
with open(file_path, 'r') as file:
198+
content = yaml.safe_load(file)
199+
if content is None:
200+
continue
201+
yml_files_content.append(content)
202+
except yaml.YAMLError as e:
203+
print(f"::error::Error parsing YAML file: {e}")
204+
continue
205+
except Exception as e:
206+
print(f"::error::Error reading file: {e}")
207+
continue
173208

174209
config_file = os.path.join(rtt_root, 'bsp', bsp, '.config')
175210

@@ -179,10 +214,18 @@ def build_bsp_attachconfig(bsp, attach_file):
179214
config_bacakup = config_file+'.origin'
180215
shutil.copyfile(config_file, config_bacakup)
181216
with open(config_file, 'a') as destination:
182-
for line in details.get('kconfig'):
183-
destination.write(line + '\n')
184-
scons_arg = details.get('scons_arg')
185-
scons_arg_str = scons_arg[0] if scons_arg else ' '
217+
if(projects.get(name) is not None):
218+
detail_list,scons_arg_list=get_details_and_dependencies([name],projects)
219+
for line in detail_list:
220+
destination.write(line + '\n')
221+
scons_arg=[]
222+
if details.get('scons_arg') is not None:
223+
for line in details.get('scons_arg'):
224+
scons_arg.append(line)
225+
if scons_arg_list is not None:
226+
for line in scons_arg_list:
227+
scons_arg.append(line)
228+
scons_arg_str=' '.join(scons_arg) if scons_arg else ' '
186229
print(f"::group::\tCompiling yml project: =={count}==={name}=scons_arg={scons_arg_str}==")
187230
res = build_bsp(bsp, scons_arg_str)
188231
if not res:

0 commit comments

Comments
 (0)