Skip to content

Commit 8795d16

Browse files
committed
fix(wifi_remote): Fix CI builds to generate configs per slave selection
Rather than keeping sdkconfig.ci.*** for the smoke tests in git
1 parent e9ac41e commit 8795d16

File tree

4 files changed

+45
-6
lines changed

4 files changed

+45
-6
lines changed

.github/workflows/wifi_remote__build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
name: Check API compatibility of WiFi Remote
1414
strategy:
1515
matrix:
16-
idf_ver: ["latest"]
16+
idf_ver: ["latest", "release-v5.3"]
1717
runs-on: ubuntu-20.04
1818
container: espressif/idf:${{ matrix.idf_ver }}
1919
steps:
@@ -33,7 +33,7 @@ jobs:
3333
name: Build WiFi Remote Test
3434
strategy:
3535
matrix:
36-
idf_ver: ["latest"]
36+
idf_ver: ["latest", "release-v5.3"]
3737
test: [ { app: smoke_test, path: "test/smoke_test" }]
3838
runs-on: ubuntu-20.04
3939
container: espressif/idf:${{ matrix.idf_ver }}
@@ -49,6 +49,7 @@ jobs:
4949
run: |
5050
. ${IDF_PATH}/export.sh
5151
pip install idf-component-manager idf-build-apps --upgrade
52+
python ./scripts/generate_slave_configs.py ./components/esp_wifi_remote/${{matrix.test.path}}
5253
python ./ci/build_apps.py ./components/esp_wifi_remote/${{matrix.test.path}} -vv --preserve-all
5354
5455
build_wifi_remote_example:
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
2+
# SPDX-License-Identifier: Apache-2.0
3+
import os
4+
import re
5+
import sys
6+
7+
if len(sys.argv) < 2:
8+
print('Usage: python generate_slave_configs.py <output_directory>')
9+
sys.exit(1)
10+
output_directory = sys.argv[1]
11+
12+
# Input Kconfig file
13+
kconfig_file = f"idf_v{os.getenv('ESP_IDF_VERSION')}/Kconfig.slave_select.in"
14+
15+
# Output file prefix
16+
output_prefix = 'sdkconfig.ci.'
17+
18+
# Regex pattern to match all available options for SLAVE_IDF_TARGET
19+
pattern = r'^ *config SLAVE_IDF_TARGET_(\w+)'
20+
21+
# Read the Kconfig and generate specific sdkconfig.ci.{slave} for each option
22+
with open(kconfig_file, 'r') as file:
23+
for line in file:
24+
match = re.match(pattern, line)
25+
if match:
26+
slave = match.group(1)
27+
output_file = os.path.join(output_directory, f'{output_prefix}{slave.lower()}')
28+
29+
with open(output_file, 'w') as out_file:
30+
out_file.write(f'CONFIG_SLAVE_IDF_TARGET_{slave.upper()}=y\n')
31+
32+
print(f'Generated: {output_file}')
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
idf_component_register(SRCS "esp_hosted_mock.c"
2-
INCLUDE_DIRS "include"
1+
set(IDF_VER_DIR "idf_v$ENV{ESP_IDF_VERSION}")
2+
3+
idf_component_register(SRCS "${IDF_VER_DIR}/esp_hosted_mock.c"
4+
INCLUDE_DIRS "${IDF_VER_DIR}/include" "include"
35
REQUIRES esp_wifi esp_wifi_remote)
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
idf_component_register(SRCS "smoke_test.c" "all_wifi_calls.c" "all_wifi_remote_calls.c"
2-
INCLUDE_DIRS ".")
1+
set(IDF_VER_DIR "idf_v$ENV{ESP_IDF_VERSION}")
2+
3+
idf_component_register(SRCS "smoke_test.c"
4+
"${IDF_VER_DIR}/all_wifi_calls.c"
5+
"${IDF_VER_DIR}/all_wifi_remote_calls.c"
6+
INCLUDE_DIRS ".")

0 commit comments

Comments
 (0)