Skip to content

Commit 95294f5

Browse files
committed
fix(mosq): Add consistency check for api docs and versions
1 parent 5dcc333 commit 95294f5

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/mosq__build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,30 @@ jobs:
7373
mv $dir build
7474
python -m pytest --log-cli-level DEBUG --junit-xml=./results_esp32_${{ matrix.idf_ver }}_${dir#"ci/build_"}.xml --target=esp32
7575
done
76+
77+
check_consistency:
78+
name: Checks that API docs and versions are consistent
79+
runs-on: ubuntu-latest
80+
steps:
81+
- uses: actions/checkout@v4
82+
- name: Checks API Docs and versions
83+
run: |
84+
sudo apt-get update
85+
sudo apt-get -y install doxygen
86+
pip install esp-doxybook
87+
cd components/mosquitto
88+
cp api.md api_orig.md
89+
./generate_api_docs.sh
90+
diff -wB api.md api_orig.md
91+
# check version consistency
92+
CONFIG_VERSION=$(grep -Po '(?<=#define VERSION ")[^"]*' port/priv_include/config.h)
93+
CZ_VERSION=$(grep -Po '(?<=version: )[^"]*' .cz.yaml)
94+
COMP_VERSION=$(grep -Po '(?<=version: ")[^"]*' idf_component.yml)
95+
if [ "$CONFIG_VERSION" != "v$CZ_VERSION" ] || [ "$CONFIG_VERSION" != "v$COMP_VERSION" ]; then
96+
echo "Version mismatch detected:"
97+
echo "config.h: $CONFIG_VERSION"
98+
echo ".cz.yaml: $CZ_VERSION"
99+
echo "idf_component.yml: $COMP_VERSION"
100+
exit 1
101+
fi
102+
echo "Versions are consistent: $CONFIG_VERSION"

0 commit comments

Comments
 (0)