Skip to content

Commit f7646bf

Browse files
committed
Merge branch 'ci-validate-zap-common' into 'main'
CI: enforce zap common files validations when updating submodule See merge request app-frameworks/esp-matter!1068
2 parents 51e5f95 + da1f78a commit f7646bf

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

.gitlab-ci.yml

+22-7
Original file line numberDiff line numberDiff line change
@@ -166,25 +166,40 @@ build_image:
166166
- chip_head_in_readme=$(awk -F'[][]' '/commit \[.* of connectedhomeip/{print $2}' README.md)
167167

168168
# Check both conditions and collect errors
169-
- commit_validation_error=0
169+
- validation_error=0
170170
- |
171171
if echo "$chip_head_commit" | grep -q "^${chip_head_in_readme}"; then
172-
echo "README.md is not in sync with the connectedhomeip submodule"
172+
echo "README.md is in sync with the connectedhomeip submodule"
173173
else
174-
echo "Please update the README.md file with the latest commit hash of the connectedhomeip submodule"
175-
commit_validation_error=1
174+
echo "ERROR:Please update the README.md file with the latest commit hash of the connectedhomeip submodule"
175+
validation_error=1
176176
fi
177177
178178
- |
179179
if echo "${chip_head_commit}" | grep -q "^${CHIP_SHORT_HASH}"; then
180180
echo "The CHIP_SHORT_HASH variable is set to correct value. Matches with current head commit"
181181
else
182-
echo "The CHIP_SHORT_HASH seems to be incorrect or you have updated the submodule but not the CHIP_SHORT_HASH variable above"
183-
commit_validation_error=1
182+
echo "ERROR: The CHIP_SHORT_HASH seems to be incorrect or you have updated the submodule but not the CHIP_SHORT_HASH variable above"
183+
validation_error=1
184+
fi
185+
186+
# Validate if we have the latest ZAP common files
187+
# python3 is not installed in dind image, so we need to install it
188+
- apk add --no-cache python3
189+
# update the submodule to so that script runs based on that submodule
190+
- git submodule update --init --depth 1 connectedhomeip/connectedhomeip
191+
- python3 components/esp_matter/zap_common/generate_zap_common_files.py
192+
- |
193+
if git diff --quiet components/esp_matter/zap_common; then
194+
echo "ZAP common files are up to date."
195+
else
196+
echo "ERROR: ZAP common files are not up to date."
197+
echo " Please run ./components/esp_matter/zap_common/generate_zap_common_files.py and commit the changes."
198+
validation_error=1
184199
fi
185200
186201
# Exit with collected error status
187-
- if [ $commit_validation_error -ne 0 ]; then exit 1; fi
202+
- if [ $validation_error -ne 0 ]; then exit 1; fi
188203

189204
- TAG="chip_${CHIP_SHORT_HASH}_idf_${IDF_VERSION}"
190205
- echo $TAG

0 commit comments

Comments
 (0)