Skip to content

Commit

Permalink
Merge branch 'ci/update_target_test_dev' into 'master'
Browse files Browse the repository at this point in the history
ci: Update target test device

See merge request adf/esp-adf-internal!1355
  • Loading branch information
jason-mao committed Dec 3, 2024
2 parents ae35314 + 923f639 commit 8dffd07
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 88 deletions.
14 changes: 7 additions & 7 deletions .gitlab/ci/build-examples-v5-x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
- IDF_VERSION_TAG: ['v5.1', 'v5.2', 'v5.3']
parallel: [1/2, 2/2]

build_examples_cmake_esp32_lyrat_v4_3:
.build_examples_esp32_lyrat_v4_3:
extends:
- .rules:build:regular-board-idf-ver-tag
- .build_cmake_template
Expand All @@ -101,16 +101,16 @@ build_examples_cmake_esp32_lyrat_v4_3:
IDF_TARGET: esp32
AUDIO_BOARD: ESP_LYRAT_V4_3

build_examples_cmake_esp32_lyrat_mini_v1_1:
build_examples_esp32_lyrat_mini_v1_1:
extends:
- .rules:build:non-regular-board-idf-ver-tag
- .rules:build:regular-board-idf-ver-tag
- .build_cmake_template
- .matrix_template_esp32_esp32s3_esp32s2
variables:
IDF_TARGET: esp32
AUDIO_BOARD: ESP_LYRAT_MINI_V1_1

build_examples_cmake_esp32s2_kaluga_v1_2:
build_examples_esp32s2_kaluga_v1_2:
extends:
- .rules:build:regular-board-idf-ver-tag
- .build_cmake_template
Expand All @@ -119,7 +119,7 @@ build_examples_cmake_esp32s2_kaluga_v1_2:
IDF_TARGET: esp32s2
AUDIO_BOARD: ESP32_S2_KALUGA_1_V1_2

build_examples_cmake_esp32s3_korvo_v2:
build_examples_esp32s3_korvo_v2:
extends:
- .rules:build:regular-board-idf-ver-tag
- .build_cmake_template
Expand All @@ -128,7 +128,7 @@ build_examples_cmake_esp32s3_korvo_v2:
IDF_TARGET: esp32s3
AUDIO_BOARD: ESP32_S3_KORVO2_V3

build_examples_cmake_esp32c3_lyra_v2:
build_examples_esp32c3_lyra_v2:
extends:
- .rules:build:regular-board-idf-ver-tag
- .build_cmake_template
Expand All @@ -137,7 +137,7 @@ build_examples_cmake_esp32c3_lyra_v2:
IDF_TARGET: esp32c3
AUDIO_BOARD: ESP32_C3_LYRA_V2

build_examples_cmake_esp32c6_devkit:
build_examples_esp32c6_devkit:
extends:
- .rules:build:regular-board-idf-ver-tag
- .build_cmake_template_c6
Expand Down
13 changes: 1 addition & 12 deletions .gitlab/ci/rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
rules:
- <<: *if-label-micropython-test
- <<: *if-protected
- <<: *if-schedule
- <<: *if-merge_request_event

.rules:ref:check-label:
rules:
Expand All @@ -122,14 +122,3 @@
- <<: *if-idf-version-tag-v5-1
- <<: *if-idf-version-tag-v5-2
- <<: *if-idf-version-tag-v5-3

.rules:build:non-regular-board-idf-ver-tag:
rules:
- <<: *if-dev-push
when: never
- <<: *if-merge_request_event
when: never
- <<: *if-idf-version-tag-v5-0
- <<: *if-idf-version-tag-v5-1
- <<: *if-idf-version-tag-v5-2
- <<: *if-idf-version-tag-v5-3
48 changes: 24 additions & 24 deletions .gitlab/ci/target-examples-test-v5-x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ example_test_pytest_esp32_v5.0:
IDF_TARGET: esp32
IDF_VERSION_TAG: release/v5.0
needs:
- 'build_examples_cmake_esp32_lyrat_v4_3: [v5.0, 1/2]'
- 'build_examples_cmake_esp32_lyrat_v4_3: [v5.0, 2/2]'
- 'build_examples_esp32_lyrat_mini_v1_1: [v5.0, 1/2]'
- 'build_examples_esp32_lyrat_mini_v1_1: [v5.0, 2/2]'
tags: [ esp32, ADF_EXAMPLE_GENERIC ]

example_test_pytest_esp32_v5.1:
Expand All @@ -67,8 +67,8 @@ example_test_pytest_esp32_v5.1:
IDF_TARGET: esp32
IDF_VERSION_TAG: release/v5.1
needs:
- 'build_examples_cmake_esp32_lyrat_v4_3: [v5.1, 1/2]'
- 'build_examples_cmake_esp32_lyrat_v4_3: [v5.1, 2/2]'
- 'build_examples_esp32_lyrat_mini_v1_1: [v5.1, 1/2]'
- 'build_examples_esp32_lyrat_mini_v1_1: [v5.1, 2/2]'
tags: [ esp32, ADF_EXAMPLE_GENERIC ]

example_test_pytest_esp32s2_v5.0:
Expand All @@ -79,8 +79,8 @@ example_test_pytest_esp32s2_v5.0:
IDF_VERSION_TAG: release/v5.0
AUDIO_BOARD: ESP32_S2_KALUGA_1_V1_2
needs:
- 'build_examples_cmake_esp32s2_kaluga_v1_2: [v5.0, 1/2]'
- 'build_examples_cmake_esp32s2_kaluga_v1_2: [v5.0, 2/2]'
- 'build_examples_esp32s2_kaluga_v1_2: [v5.0, 1/2]'
- 'build_examples_esp32s2_kaluga_v1_2: [v5.0, 2/2]'
tags: [ esp32s2, ADF_EXAMPLE_GENERIC ]

example_test_pytest_esp32s2_v5.1:
Expand All @@ -91,8 +91,8 @@ example_test_pytest_esp32s2_v5.1:
IDF_VERSION_TAG: release/v5.1
AUDIO_BOARD: ESP32_S2_KALUGA_1_V1_2
needs:
- 'build_examples_cmake_esp32s2_kaluga_v1_2: [v5.1, 1/2]'
- 'build_examples_cmake_esp32s2_kaluga_v1_2: [v5.1, 2/2]'
- 'build_examples_esp32s2_kaluga_v1_2: [v5.1, 1/2]'
- 'build_examples_esp32s2_kaluga_v1_2: [v5.1, 2/2]'
tags: [ esp32s2, ADF_EXAMPLE_GENERIC ]

example_test_pytest_esp32s3_v5.0:
Expand All @@ -102,8 +102,8 @@ example_test_pytest_esp32s3_v5.0:
IDF_TARGET: esp32s3
IDF_VERSION_TAG: release/v5.0
needs:
- 'build_examples_cmake_esp32s3_korvo_v2: [v5.0, 1/2]'
- 'build_examples_cmake_esp32s3_korvo_v2: [v5.0, 2/2]'
- 'build_examples_esp32s3_korvo_v2: [v5.0, 1/2]'
- 'build_examples_esp32s3_korvo_v2: [v5.0, 2/2]'
tags: [ esp32s3, ADF_EXAMPLE_GENERIC ]

example_test_pytest_esp32s3_v5.1:
Expand All @@ -113,8 +113,8 @@ example_test_pytest_esp32s3_v5.1:
IDF_TARGET: esp32s3
IDF_VERSION_TAG: release/v5.1
needs:
- 'build_examples_cmake_esp32s3_korvo_v2: [v5.1, 1/2]'
- 'build_examples_cmake_esp32s3_korvo_v2: [v5.1, 2/2]'
- 'build_examples_esp32s3_korvo_v2: [v5.1, 1/2]'
- 'build_examples_esp32s3_korvo_v2: [v5.1, 2/2]'
tags: [ esp32s3, ADF_EXAMPLE_GENERIC ]

example_test_pytest_esp32_v5.2:
Expand All @@ -124,8 +124,8 @@ example_test_pytest_esp32_v5.2:
IDF_TARGET: esp32
IDF_VERSION_TAG: release/v5.2
needs:
- 'build_examples_cmake_esp32_lyrat_v4_3: [v5.2, 1/2]'
- 'build_examples_cmake_esp32_lyrat_v4_3: [v5.2, 2/2]'
- 'build_examples_esp32_lyrat_mini_v1_1: [v5.2, 1/2]'
- 'build_examples_esp32_lyrat_mini_v1_1: [v5.2, 2/2]'
tags: [ esp32, ADF_EXAMPLE_GENERIC ]

example_test_pytest_esp32s2_v5.2:
Expand All @@ -136,8 +136,8 @@ example_test_pytest_esp32s2_v5.2:
IDF_VERSION_TAG: release/v5.2
AUDIO_BOARD: ESP32_S2_KALUGA_1_V1_2
needs:
- 'build_examples_cmake_esp32s2_kaluga_v1_2: [v5.2, 1/2]'
- 'build_examples_cmake_esp32s2_kaluga_v1_2: [v5.2, 2/2]'
- 'build_examples_esp32s2_kaluga_v1_2: [v5.2, 1/2]'
- 'build_examples_esp32s2_kaluga_v1_2: [v5.2, 2/2]'
tags: [ esp32s2, ADF_EXAMPLE_GENERIC ]

example_test_pytest_esp32s3_v5.2:
Expand All @@ -147,8 +147,8 @@ example_test_pytest_esp32s3_v5.2:
IDF_TARGET: esp32s3
IDF_VERSION_TAG: release/v5.2
needs:
- 'build_examples_cmake_esp32s3_korvo_v2: [v5.2, 1/2]'
- 'build_examples_cmake_esp32s3_korvo_v2: [v5.2, 2/2]'
- 'build_examples_esp32s3_korvo_v2: [v5.2, 1/2]'
- 'build_examples_esp32s3_korvo_v2: [v5.2, 2/2]'
tags: [ esp32s3, ADF_EXAMPLE_GENERIC ]

example_test_pytest_esp32_v5.3:
Expand All @@ -158,8 +158,8 @@ example_test_pytest_esp32_v5.3:
IDF_TARGET: esp32
IDF_VERSION_TAG: release/v5.3
needs:
- 'build_examples_cmake_esp32_lyrat_v4_3: [v5.3, 1/2]'
- 'build_examples_cmake_esp32_lyrat_v4_3: [v5.3, 2/2]'
- 'build_examples_esp32_lyrat_mini_v1_1: [v5.3, 1/2]'
- 'build_examples_esp32_lyrat_mini_v1_1: [v5.3, 2/2]'
tags: [ esp32, ADF_EXAMPLE_GENERIC ]

example_test_pytest_esp32s2_v5.3:
Expand All @@ -170,8 +170,8 @@ example_test_pytest_esp32s2_v5.3:
IDF_VERSION_TAG: release/v5.3
AUDIO_BOARD: ESP32_S2_KALUGA_1_V1_2
needs:
- 'build_examples_cmake_esp32s2_kaluga_v1_2: [v5.3, 1/2]'
- 'build_examples_cmake_esp32s2_kaluga_v1_2: [v5.3, 2/2]'
- 'build_examples_esp32s2_kaluga_v1_2: [v5.3, 1/2]'
- 'build_examples_esp32s2_kaluga_v1_2: [v5.3, 2/2]'
tags: [ esp32s2, ADF_EXAMPLE_GENERIC ]

example_test_pytest_esp32s3_v5.3:
Expand All @@ -181,6 +181,6 @@ example_test_pytest_esp32s3_v5.3:
IDF_TARGET: esp32s3
IDF_VERSION_TAG: release/v5.3
needs:
- 'build_examples_cmake_esp32s3_korvo_v2: [v5.3, 1/2]'
- 'build_examples_cmake_esp32s3_korvo_v2: [v5.3, 2/2]'
- 'build_examples_esp32s3_korvo_v2: [v5.3, 1/2]'
- 'build_examples_esp32s3_korvo_v2: [v5.3, 2/2]'
tags: [ esp32s3, ADF_EXAMPLE_GENERIC ]
Original file line number Diff line number Diff line change
Expand Up @@ -402,9 +402,13 @@ void app_main(void)
i2s_stream_cfg_t i2s_cfg2 = I2S_STREAM_CFG_DEFAULT();
i2s_cfg2.type = AUDIO_STREAM_READER;
#if defined CONFIG_ESP_LYRAT_MINI_V1_1_BOARD
i2s_cfg2.i2s_port = 1;
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
i2s_cfg2.chan_cfg.id = I2S_NUM_1;
#else
i2s_cfg2.i2s_port = I2S_NUM_1;
i2s_cfg2.i2s_config.use_apll = false;
#endif
#endif /* ESP_IDF_VERSION <= ESP_IDF_VERSION_VAL(5, 0, 0) */
#endif /* CONFIG_ESP_LYRAT_MINI_V1_1_BOARD */
i2s_stream_reader = i2s_stream_init(&i2s_cfg2);

raw_stream_cfg_t raw_cfg = RAW_STREAM_CFG_DEFAULT();
Expand Down Expand Up @@ -486,7 +490,7 @@ void app_main(void)
continue;
}

if (msg.source_type == AUDIO_ELEMENT_TYPE_ELEMENT && msg.source == (void *) bt_stream_reader
if (msg.source_type == AUDIO_ELEMENT_TYPE_ELEMENT && msg.source == (void *)bt_stream_reader
&& msg.cmd == AEL_MSG_CMD_REPORT_MUSIC_INFO) {
audio_element_info_t music_info = {0};
audio_element_getinfo(bt_stream_reader, &music_info);
Expand All @@ -509,16 +513,16 @@ void app_main(void)
if ((msg.source_type == PERIPH_ID_TOUCH || msg.source_type == PERIPH_ID_BUTTON || msg.source_type == PERIPH_ID_ADC_BTN)
&& (msg.cmd == PERIPH_TOUCH_TAP || msg.cmd == PERIPH_BUTTON_PRESSED || msg.cmd == PERIPH_ADC_BUTTON_PRESSED)) {

if ((int) msg.data == get_input_play_id()) {
if ((int)msg.data == get_input_play_id()) {
ESP_LOGI(TAG, "[ * ] [Play] touch tap event");
periph_bluetooth_play(bt_periph);
} else if ((int) msg.data == get_input_set_id()) {
} else if ((int)msg.data == get_input_set_id()) {
ESP_LOGI(TAG, "[ * ] [Set] touch tap event");
periph_bluetooth_pause(bt_periph);
} else if ((int) msg.data == get_input_volup_id()) {
} else if ((int)msg.data == get_input_volup_id()) {
ESP_LOGI(TAG, "[ * ] [Vol+] touch tap event");
periph_bluetooth_next(bt_periph);
} else if ((int) msg.data == get_input_voldown_id()) {
} else if ((int)msg.data == get_input_voldown_id()) {
ESP_LOGI(TAG, "[ * ] [Vol-] touch tap event");
periph_bluetooth_prev(bt_periph);
}
Expand All @@ -533,8 +537,8 @@ void app_main(void)
}
}
/* Stop when the last pipeline element (i2s_stream_writer in this case) receives stop event */
if (msg.source_type == AUDIO_ELEMENT_TYPE_ELEMENT && msg.source == (void *) i2s_stream_writer
&& msg.cmd == AEL_MSG_CMD_REPORT_STATUS && (int) msg.data == AEL_STATUS_STATE_STOPPED) {
if (msg.source_type == AUDIO_ELEMENT_TYPE_ELEMENT && msg.source == (void *)i2s_stream_writer
&& msg.cmd == AEL_MSG_CMD_REPORT_STATUS && (int)msg.data == AEL_STATUS_STATE_STOPPED) {
ESP_LOGW(TAG, "[ * ] Stop event received");
break;
}
Expand Down
2 changes: 1 addition & 1 deletion tools/ci/apps_filter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ for num in $(seq 0 $len); do
idf_vers=$(echo $board | tr ',' ' ')
idf_version_control ${idf_vers[@]}
else
echo "skip"
echo -e "\e[31m ERROR: \"$audio_hal\" not found in the \"$audio_board_idf_json_path\" JSON file \e[0m"
fi
else
echo "skip"
Expand Down
5 changes: 1 addition & 4 deletions tools/ci/build_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,7 @@ def main(args): # type: (argparse.Namespace) -> None
apps_to_build = apps[:]

print(f'Found {len(apps_to_build)} apps after filtering')
print(
'Suggest setting the parallel count to %d for this build job',
len(apps_to_build) // APPS_BUILD_PER_JOB + 1,
)
print(f'Suggest setting the parallel count to {len(apps_to_build) // APPS_BUILD_PER_JOB + 1} for this build job')

ret_code = build_apps(
apps_to_build,
Expand Down
43 changes: 12 additions & 31 deletions tools/ci/check_apps_json_and_sdkcfg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ else
echo "The jq tool has been installed"
fi

cat apps.txt | grep -o '/examples/.*' > check_apps_json_and_sdk.txt
BOARD_NAME=(`cat $ADF_PATH/tools/ci/apps.json | grep -E "ESP+[0-9a-zA-Z_]+" -o | sort -u -r`)
cat apps.txt | grep -o 'examples/.*' > check_apps_json_and_sdk.txt
BOARD_NAME=(`cat $ADF_PATH/tools/ci/audio_board_idf.json | grep -E "ESP+[0-9a-zA-Z_]+" -o | sort -u -r`)
APPS_CHECK_RESULT="OK"

function check_sdkcfg() {
CHIP_TYPES=(`echo $audio_boards | grep -E "esp+[0-9a-z]+" -o | sort -u`)
if [ ! -f $ADF_PATH${line}"/sdkconfig.defaults" ]; then
if [ ! -f $ADF_PATH"/${line}/sdkconfig.defaults" ]; then
echo -e "\e[31m ERROR: sdkconfig.defaults is missing in " $line " \e[0m"
APPS_CHECK_RESULT="FAIL"
fi

for chip in ${CHIP_TYPES[*]}
do
if [ ! -f $ADF_PATH${line}"/sdkconfig.defaults."$chip ]; then
if [ ! -f $ADF_PATH"/${line}/sdkconfig.defaults."$chip ]; then
echo -e "\e[31m ERROR: sdkconfig.defaults." $chip "is missing in " $line " \e[0m"
APPS_CHECK_RESULT="FAIL"
fi
Expand All @@ -54,50 +54,31 @@ function check_audio_board() {
fi
}

function check_audio_board_idf_ver() {
result=${result%;*}
chip_board_idf_ver_list=(`echo $result | tr ';' ' '` )
for chip_board_idf_ver in ${chip_board_idf_ver_list[*]}
do
idf_ver=$(echo $chip_board_idf_ver | grep '\[v[0-9][0-9]' -o)
if [ ! -n "$idf_ver" ];then
echo "The error occurs in the definition of" ${line} "in apps.json"
echo -e "\e[31m ERROR: not found" $chip_board_idf_ver "support idf version \e[0m"
APPS_CHECK_RESULT="FAIL"
fi
done
}

function update_audio_hal() {
if [ -f $ADF_PATH${line}"/"$1 ]; then
old_config=$(sed -n '/_BOARD=y/p' $ADF_PATH${line}"/"$1)
if [ -f $ADF_PATH"/${line}/"$1 ]; then
old_config=$(sed -n '/_BOARD=y/p' $ADF_PATH"/${line}/"$1)
if [ ! -z ${old_config} ]; then
new_config="CONFIG_"$2"_BOARD=y"
sed -i "s%${old_config}%${new_config}%" $ADF_PATH${line}"/"$1
sed -i "s%${old_config}%${new_config}%" $ADF_PATH"/${line}/"$1
# It is easy to see the change of audio_hal
# echo $ADF_PATH${line}"/"$1 "AUDIO_BOARD:"$old_config " --> " $new_config
# echo $ADF_PATH"/${line}/"$1 "AUDIO_BOARD:"$old_config " --> " $new_config
else
sed -i '$a\CONFIG_'$2'_BOARD=y' $ADF_PATH${line}"/"$1
cat $ADF_PATH${line}"/"$1
sed -i '$a\CONFIG_'$2'_BOARD=y' $ADF_PATH"/${line}/"$1
fi
else
echo -e "\e[33m WARNING: " $ADF_PATH${line}"/"$1 " skip \e[0m"
echo -e "\e[33m WARNING: " $ADF_PATH"/${line}/"$1 " skip \e[0m"
fi
}

while read line
do
result=$(cat ${ADF_PATH}/tools/ci/apps.json | grep -E $line)
if [ -n "$result" ];then
audio_boards=${result#*:*:}
if jq ".[] | .app_dir == \"$line\"" ${ADF_PATH}/tools/ci/apps.json > /dev/null; then
audio_boards=$(jq ".[] | select(.app_dir == \"$line\") | .board" ${ADF_PATH}/tools/ci/apps.json)

# Check if the example's file(sdkconfg.defaults.xxx / sdkconfg.defaults) is missing
check_sdkcfg
# Does the example define supported board types
check_audio_board
# Check if idf version is defined
check_audio_board_idf_ver

# Update AUDIO_BOARD
update_audio_hal $1 $2

Expand Down

0 comments on commit 8dffd07

Please sign in to comment.