mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
Merge branch 'ci/drop-idf-v4.4' into 'main'
cleanups: drop ESP-IDF v4.4 from ci and remove check_typos.sh See merge request app-frameworks/esp-matter!1481
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
# Copyright 2025 Espressif Systems (Shanghai) PTE LTD
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
name: Check Typos
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- 'release/**'
|
||||
|
||||
jobs:
|
||||
check_typos:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install codespell
|
||||
run: pip install codespell
|
||||
- name: Fetch main branch
|
||||
run: git fetch origin main
|
||||
- name: Check typos in changed files
|
||||
run: |
|
||||
FILES=$(git diff --name-only origin/main...HEAD)
|
||||
echo "Changed files: $FILES"
|
||||
if [ -n "$FILES" ]; then
|
||||
./tools/check_typos.sh $FILES
|
||||
else
|
||||
echo "No files changed, skipping typo check"
|
||||
fi
|
||||
+1
-56
@@ -238,7 +238,6 @@ build_image:
|
||||
matrix:
|
||||
# Change the idf version here in case of idf version change MR.
|
||||
- IDF_VERSION:
|
||||
- "v4.4.3"
|
||||
- "v5.4.1"
|
||||
|
||||
.build_examples_template:
|
||||
@@ -249,7 +248,6 @@ build_image:
|
||||
needs:
|
||||
- job: build_image
|
||||
optional: true
|
||||
- job: check_typos
|
||||
- job: pre_commit_check
|
||||
tags:
|
||||
- build
|
||||
@@ -470,42 +468,6 @@ build_nopytest_remaining_examples_manual:
|
||||
parallel: 2
|
||||
|
||||
|
||||
build_esp_matter_examples_idf_v4_4:
|
||||
resource_group: build_esp_matter_examples_idf_v4_4
|
||||
extends:
|
||||
- .build_examples_template
|
||||
image: ${DOCKER_IMAGE_NAME}:chip_${CHIP_SHORT_HASH}_idf_${IDF_CHECKOUT_REF}
|
||||
allow_failure: true
|
||||
artifacts:
|
||||
paths:
|
||||
- "examples/**/build*/size.json"
|
||||
- "examples/**/build*/build_log.txt"
|
||||
- "examples/**/build*/*.map"
|
||||
- "examples/**/build*/*.bin"
|
||||
- "examples/**/build*/flasher_args.json"
|
||||
- "examples/**/build*/config/sdkconfig.json"
|
||||
- "examples/**/build*/bootloader/*.bin"
|
||||
- "examples/**/build*/partition_table/*.bin"
|
||||
when: always
|
||||
expire_in: 4 days
|
||||
script:
|
||||
- cd ${ESP_MATTER_PATH}
|
||||
# idf v4.4 requires jinja < 3.1 so lets install the dependencies for idf v4.4
|
||||
- pip install -r requirements_idf_v4.4.txt
|
||||
# hack the construct==2.10.54 to make it work with idf-v4.4, Python3.12
|
||||
# imp is not present in Python3.12 so remove it
|
||||
- wget https://files.pythonhosted.org/packages/30/2f/e2e6bad1b80f744cf5c2a6d622e3dee698b43e6c040f980ae0ac0edd5e54/construct-2.10.54.tar.gz
|
||||
- tar -xvzf construct-2.10.54.tar.gz
|
||||
- sed -i 's/, imp$//g' construct-2.10.54/construct/core.py
|
||||
- python3 -m pip install ./construct-2.10.54
|
||||
- rm -rf construct-2.10.54*
|
||||
- cd ${ESP_MATTER_PATH}/examples/light
|
||||
- idf.py set-target esp32c3
|
||||
- idf.py build
|
||||
variables:
|
||||
IDF_CHECKOUT_REF: "v4.4.3"
|
||||
|
||||
|
||||
build_esp_matter_examples_pytest_C3:
|
||||
resource_group: build_esp_matter_examples_pytest_C3
|
||||
extends:
|
||||
@@ -682,7 +644,6 @@ build_managed_component_light:
|
||||
needs:
|
||||
- job: build_image
|
||||
optional: true
|
||||
- job: check_typos
|
||||
- job: pre_commit_check
|
||||
script:
|
||||
- cd ${ESP_MATTER_PATH}/examples/managed_component_light
|
||||
@@ -718,7 +679,6 @@ build_esp_rainmaker_apps:
|
||||
needs:
|
||||
- job: build_image
|
||||
optional: true
|
||||
- job: check_typos
|
||||
- job: pre_commit_check
|
||||
|
||||
artifacts:
|
||||
@@ -760,7 +720,7 @@ build_docs:
|
||||
tags:
|
||||
- build
|
||||
needs:
|
||||
- job: check_typos
|
||||
- job: pre_commit_check
|
||||
variables:
|
||||
ESP_DOCS_LATEST_BRANCH_NAME: "main"
|
||||
artifacts:
|
||||
@@ -823,21 +783,6 @@ deploy_docs_production:
|
||||
DOCS_DEPLOY_PATH: "$DOCS_PROD_PATH"
|
||||
DOCS_DEPLOY_URL_BASE: "https://$DOCS_PROD_SERVER/$DOCS_PROD_PATH"
|
||||
|
||||
check_typos:
|
||||
image: $CI_DOCKER_REGISTRY/esp-env-v6.0:1
|
||||
stage: pre_check
|
||||
script:
|
||||
- pip install codespell
|
||||
- git fetch origin main
|
||||
- |
|
||||
FILES=$(git diff --name-only origin/main...HEAD)
|
||||
echo "change files: $FILES"
|
||||
if [ -n "$FILES" ]; then
|
||||
./tools/check_typos.sh $FILES
|
||||
fi
|
||||
tags:
|
||||
- build
|
||||
|
||||
pre_commit_check:
|
||||
image: $CI_DOCKER_REGISTRY/esp-env-v6.0:1
|
||||
stage: pre_check
|
||||
|
||||
+1
-8
@@ -392,13 +392,6 @@ idf_build_set_property(COMPILE_OPTIONS "-Wno-error=uninitialized;-Wno-error=mayb
|
||||
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=array-bounds" APPEND)
|
||||
idf_build_set_property(COMPILE_OPTIONS "-Wno-write-strings" APPEND)
|
||||
|
||||
# For Xtensa chips, uint32_t was defined as 'unsigned' before v5.0, and after IDF v5.0 it is defined
|
||||
# as 'unsigned long', same as RISC-V. add this compile option to avoid format errors.
|
||||
# https://github.com/espressif/esp-idf/issues/6906#issuecomment-1207373706
|
||||
if (CONFIG_IDF_TARGET_ARCH_XTENSA AND (${IDF_VERSION_MAJOR} LESS 5))
|
||||
idf_build_set_property(COMPILE_OPTIONS "-Wno-format" APPEND)
|
||||
endif()
|
||||
|
||||
# Time sync client feature depends on read client, disable it when read client is disabled.
|
||||
if (CONFIG_DISABLE_READ_CLIENT)
|
||||
target_compile_options(${COMPONENT_LIB} PUBLIC "-DTIME_SYNC_ENABLE_TSC_FEATURE=0")
|
||||
@@ -445,6 +438,6 @@ if (false AND CONFIG_CHIP_OTA_IMAGE_BUILD)
|
||||
INPUT_FILES ${BUILD_DIR}/${CMAKE_PROJECT_NAME}.bin
|
||||
OUTPUT_FILE ${BUILD_DIR}/${CMAKE_PROJECT_NAME}-ota.bin
|
||||
)
|
||||
# Adding dependecy as app target so that this runs after images are ready
|
||||
# Adding dependency as app target so that this runs after images are ready
|
||||
add_dependencies(chip-ota-image app)
|
||||
endif()
|
||||
|
||||
@@ -80,12 +80,6 @@ endif(CONFIG_ESP_MATTER_ENABLE_MATTER_SERVER)
|
||||
target_sources(${COMPONENT_LIB} PRIVATE ${MATTER_SDK_PATH}/src/app/StorageDelegateWrapper.cpp
|
||||
${MATTER_SDK_PATH}/src/app/SafeAttributePersistenceProvider.cpp)
|
||||
|
||||
# For Xtensa chips, uint32_t was defined as 'unsigned' before v5.0, and after IDF v5.0 it is defined
|
||||
# as 'unsigned long', same as RISC-V. add this compile option to avoid format errors.
|
||||
# https://github.com/espressif/esp-idf/issues/6906#issuecomment-1207373706
|
||||
if (CONFIG_IDF_TARGET_ARCH_XTENSA AND (${IDF_VERSION_MAJOR} LESS 5))
|
||||
idf_build_set_property(COMPILE_OPTIONS "-Wno-format" APPEND)
|
||||
endif()
|
||||
target_compile_options(${COMPONENT_LIB} PUBLIC
|
||||
"-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=<lib/address_resolve/AddressResolve_DefaultImpl.h>")
|
||||
|
||||
|
||||
@@ -30,11 +30,6 @@ if(IDF_TARGET STREQUAL "esp32c2")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
get_filename_component(SDKCONFIG_SHELL_IDF_VER "${SDKCONFIG_COMMON_DIR}.shell.v4.4" ABSOLUTE)
|
||||
if(EXISTS ${SDKCONFIG_SHELL_IDF_VER} AND ${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}.${IDF_VERSION_PATCH} STRLESS "5.0.0")
|
||||
list(APPEND SDKCONFIG_FILES "${SDKCONFIG_SHELL_IDF_VER}")
|
||||
endif()
|
||||
|
||||
# setting the final sdkconfig files list to SDKCONFIG_DEFAULTS
|
||||
set(SDKCONFIG_DEFAULTS ${SDKCONFIG_FILES})
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ The following is the Memory and Flash Usage.
|
||||
|
||||
- `Bootup` == Device just finished booting up. Device is not
|
||||
commissionined or connected to wifi yet.
|
||||
- `After Commissioning` == Device is conneted to wifi and is also
|
||||
- `After Commissioning` == Device is connected to wifi and is also
|
||||
commissioned and is rebooted.
|
||||
- device used: esp32c3_devkit_m
|
||||
- tested on:
|
||||
@@ -37,4 +37,4 @@ The following is the Memory and Flash Usage.
|
||||
This should give you a good idea about the amount of free memory that is
|
||||
available for you to run your application's code.
|
||||
|
||||
Applications that do not require BLE post commissioning, can disable it using app_ble_disable() once commissioning is complete. It is not done explicitly because of a known issue with esp32c3 and will be fixed with the next IDF release (v4.4.2).
|
||||
Applications that do not require BLE post commissioning, can disable it using app_ble_disable() once commissioning is complete.
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
CONFIG_ENABLE_CHIP_SHELL=n
|
||||
@@ -11,7 +11,7 @@ See the [docs](https://docs.espressif.com/projects/esp-matter/en/latest/esp32/de
|
||||
|
||||
This example demonstrates auto subscription to only one remote on/off server from on/off client after binding of light to switch.
|
||||
For example, switch that have a led indicator which indicates the on-off state of the bound light. The subscription can keep the indicator on the switch sync with the light node.
|
||||
- Enable SUBSCRIBE_TO_ON_OFF_SERVER_AFTER_BINDING to enable this funcationality.
|
||||
- Enable SUBSCRIBE_TO_ON_OFF_SERVER_AFTER_BINDING to enable this functionality.
|
||||
Please check [Bind light to switch](#21-bind-light-to-switch) for more details.
|
||||
|
||||
## 2. Post Commissioning Setup
|
||||
@@ -186,7 +186,7 @@ The following is the Memory and Flash Usage.
|
||||
|
||||
- `Bootup` == Device just finished booting up. Device is not
|
||||
commissionined or connected to wifi yet.
|
||||
- `After Commissioning` == Device is conneted to wifi and is also
|
||||
- `After Commissioning` == Device is connected to wifi and is also
|
||||
commissioned and is rebooted.
|
||||
- device used: esp32c3_devkit_m
|
||||
- tested on:
|
||||
@@ -202,7 +202,7 @@ The following is the Memory and Flash Usage.
|
||||
This should give you a good idea about the amount of free memory that is
|
||||
available for you to run your application's code.
|
||||
|
||||
Applications that do not require BLE post commissioning, can disable it using app_ble_disable() once commissioning is complete. It is not done explicitly because of a known issue with esp32c3 and will be fixed with the next IDF release (v4.4.2).
|
||||
Applications that do not require BLE post commissioning, can disable it using app_ble_disable() once commissioning is complete.
|
||||
|
||||
## 4. Dynamic Passcode
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ The following is the Memory and Flash Usage.
|
||||
|
||||
- `Bootup` == Device just finished booting up. Device is not
|
||||
commissionined or connected to wifi yet.
|
||||
- `After Commissioning` == Device is conneted to wifi and is also
|
||||
- `After Commissioning` == Device is connected to wifi and is also
|
||||
commissioned and is rebooted.
|
||||
- device used: esp32c3_devkit_m
|
||||
- tested on:
|
||||
@@ -73,4 +73,4 @@ The following is the Memory and Flash Usage.
|
||||
This should give you a good idea about the amount of free memory that is
|
||||
available for you to run your application's code.
|
||||
|
||||
Applications that do not require BLE post commissioning, can disable it using app_ble_disable() once commissioning is complete. It is not done explicitly because of a known issue with esp32c3 and will be fixed with the next IDF release (v4.4.2).
|
||||
Applications that do not require BLE post commissioning, can disable it using app_ble_disable() once commissioning is complete.
|
||||
|
||||
@@ -44,7 +44,7 @@ The following is the Memory and Flash Usage.
|
||||
|
||||
- `Bootup` == Device just finished booting up. Device is not
|
||||
commissionined or connected to wifi yet.
|
||||
- `After Commissioning` == Device is conneted to wifi and is also
|
||||
- `After Commissioning` == Device is connected to wifi and is also
|
||||
commissioned and is rebooted.
|
||||
- device used: esp32c3_devkit_m
|
||||
- tested on:
|
||||
@@ -60,7 +60,7 @@ The following is the Memory and Flash Usage.
|
||||
This should give you a good idea about the amount of free memory that is
|
||||
available for you to run your application's code.
|
||||
|
||||
Applications that do not require BLE post commissioning, can disable it using app_ble_disable() once commissioning is complete. It is not done explicitly because of a known issue with esp32c3 and will be fixed with the next IDF release (v4.4.2).
|
||||
Applications that do not require BLE post commissioning, can disable it using app_ble_disable() once commissioning is complete.
|
||||
|
||||
## A2 Appendix FAQs
|
||||
|
||||
@@ -69,7 +69,7 @@ Applications that do not require BLE post commissioning, can disable it using ap
|
||||
The run_zaptool.py command is failing:
|
||||
|
||||
- Check that the connectedhomeip submodule is updated.
|
||||
- Revert any modifications in any of te files in the connectedhomeip
|
||||
- Revert any modifications in any of the files in the connectedhomeip
|
||||
submodule, or any submodules in connectedhomeip, and try again.
|
||||
- If you are still facing issues, reproduce the issue on the default
|
||||
example for the device and then raise an [issue](https://github.com/espressif/esp-matter/issues).
|
||||
|
||||
+2
-8
@@ -95,14 +95,8 @@ fi
|
||||
|
||||
echo_log "Installing python dependencies for Matter"
|
||||
|
||||
# Install python dependencies based on idf version
|
||||
if [[ $(git -C $IDF_PATH describe) == v4.4* ]]; then
|
||||
echo_log "Installing requirements from requirements_idf_v4.4.txt"
|
||||
python3 -m pip install -r ${ESP_MATTER_PATH}/requirements_idf_v4.4.txt >/dev/null
|
||||
else
|
||||
echo_log "Installing requirements from requirements.txt"
|
||||
python3 -m pip install -r ${ESP_MATTER_PATH}/requirements.txt > /dev/null
|
||||
fi
|
||||
echo_log "Installing requirements from requirements.txt"
|
||||
python3 -m pip install -r ${ESP_MATTER_PATH}/requirements.txt > /dev/null
|
||||
|
||||
if [ $BUILD_PYTHON = true ]; then
|
||||
echo_log "Building Python testing environment"
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
# matter idl
|
||||
lark==1.1.2
|
||||
stringcase==1.2.0
|
||||
|
||||
# esp-idf v4.4 is not compatible with newer version of jinja2,
|
||||
# so pinning it to 3.0.1
|
||||
jinja2==3.0.1
|
||||
|
||||
# https://github.com/psf/requests/blob/main/HISTORY.md#2300-2023-05-03
|
||||
# idf-component-manager from v4.4 is not compatible with newer version of urllib3
|
||||
urllib3<2
|
||||
|
||||
# mfg_tool - DISABLED for ESP-IDF v4.4 due to construct version conflict
|
||||
# esp-secure-cert-tool (dependency of esp-matter-mfg-tool) requires construct>=2.10.70
|
||||
# but ESP-IDF v4.4 hard pins construct==2.10.54, creating an unsolvable conflict
|
||||
# esp-matter-mfg-tool>=1.0.4
|
||||
@@ -1,104 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Usage: tools/check_typos.sh [source_file_or_directory] ...
|
||||
|
||||
CODESPELL_SKIP_LIST=()
|
||||
ERROR_FOUND=0
|
||||
|
||||
parse_codespellrc_skips() {
|
||||
if [ -f .codespellrc ]; then
|
||||
local skip_files
|
||||
skip_files=$(grep -E "^skip\s*=" .codespellrc | cut -d '=' -f2 | tr -d ' ')
|
||||
IFS=',' read -ra CODESPELL_SKIP_LIST <<< "$skip_files"
|
||||
fi
|
||||
}
|
||||
|
||||
should_skip_file() {
|
||||
local file_path="$1"
|
||||
for pattern in "${CODESPELL_SKIP_LIST[@]}"; do
|
||||
if [[ "$file_path" == $pattern* ]]; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
process_file() {
|
||||
local SRC_FILE="$1"
|
||||
cat "$SRC_FILE" | \
|
||||
python3 -c "
|
||||
import sys, re
|
||||
ignore_directive = re.compile(r\"[^\w\s]\s*codespell:ignore\b\")
|
||||
def split_line(line):
|
||||
if ignore_directive.search(line):
|
||||
return line.rstrip()
|
||||
tokens = re.findall(r\"\b[\w']+\b\", line)
|
||||
result = []
|
||||
for token in tokens:
|
||||
if \"'\" in token:
|
||||
result.append(token)
|
||||
else:
|
||||
result.extend(re.findall(r\"\d+[a-zA-Z]+|[A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+\", token))
|
||||
return \" \".join(result)
|
||||
for line in sys.stdin:
|
||||
print(split_line(line))
|
||||
" | codespell --check-hidden --stdin-single-line -q 32 - 2>&1 | sed "s|^|$SRC_FILE: |"
|
||||
if [ "${PIPESTATUS[2]}" -ne 0 ]; then
|
||||
ERROR_FOUND=1
|
||||
fi
|
||||
}
|
||||
|
||||
is_valid_file() {
|
||||
local file="$1"
|
||||
|
||||
case "$file" in
|
||||
*.c|*.h|*.cpp|*.py|*.txt|*.md|*.yml|*.ini|*.json|*.sh|*.cmake) ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
|
||||
if should_skip_file "$file"; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
process_directory() {
|
||||
local DIR="$1"
|
||||
local file
|
||||
|
||||
find "$DIR" -type f | while read -r file; do
|
||||
if is_valid_file "$file"; then
|
||||
process_file "$file"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
main() {
|
||||
local TARGETS=("$@")
|
||||
|
||||
parse_codespellrc_skips
|
||||
|
||||
if [ "$#" -eq 0 ]; then
|
||||
TARGETS=(./components ./examples)
|
||||
fi
|
||||
|
||||
for TARGET in "${TARGETS[@]}"; do
|
||||
if [ -f "$TARGET" ]; then
|
||||
if is_valid_file "$TARGET"; then
|
||||
process_file "$TARGET"
|
||||
fi
|
||||
elif [ -d "$TARGET" ]; then
|
||||
process_directory "$TARGET"
|
||||
else
|
||||
echo "Warning: '$TARGET' is not a valid file or directory, skipping"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$ERROR_FOUND" == "1" ]; then
|
||||
echo "Typos found"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -31,11 +31,6 @@ ENV IDF_TOOLS_PATH=/opt/espressif/tools
|
||||
|
||||
COPY --from=build /tmp/esp-idf /opt/espressif/esp-idf
|
||||
|
||||
ARG IDF_CHECKOUT_REF
|
||||
RUN if [ "$IDF_CHECKOUT_REF" = "v4.4.3" ]; then \
|
||||
sed -i 's/^gdbgui==/# gdbgui ==/' /opt/espressif/esp-idf/requirements.txt; \
|
||||
fi
|
||||
|
||||
RUN apt-get update && apt-get install -y python3-virtualenv
|
||||
|
||||
# Setup the ESP-IDF
|
||||
|
||||
Reference in New Issue
Block a user