ci: add API compatibility check job for merge requests

Add a check_api_compatibility CI job that uses esp-api-check to detect
breaking API changes in merge requests. The job compares API
declarations between the MR base and head commits using libclang, and
posts a discussion thread on the MR if WARNING or BREAKING changes are
found.

- Add CI job in host-test.yml with clang toolchain and allow_failure
- Add test_api_check project for CMake configuration with all
  components enabled
- Define __DOXYGEN__ and IDF_DOC_BUILD so the checker can see
  declarations behind these guards

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ivan Grokhotkov (bot)
2026-03-06 17:12:40 +01:00
co-authored by Claude Opus 4.6
parent 5410fc0d5c
commit 20b9e06e92
8 changed files with 44 additions and 0 deletions
+19
View File
@@ -53,6 +53,25 @@ check_public_headers:
done
done
check_api_compatibility:
extends:
- .host_test_template
- .rules:test:host_test
needs:
- pipeline_variables
variables:
IDF_TOOLCHAIN: clang
INSTALL_EXTRA_TOOLS: esp-clang-libs
allow_failure: true
script:
- pip install "esp-api-check[gitlab] @ git+https://gitlab-ci-token:${ESPCI_TOKEN}@${GITLAB_HTTPS_HOST}/espressif/esp-api-check.git"
- python -m esp_api_check install-clang-bindings
- python -m esp_api_check gitlab
--gitlab-url "https://${GITLAB_HTTPS_HOST}"
--gitlab-token ${ESPCI_TOKEN}
--head-sha ${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}
--project-dir ${CI_PROJECT_DIR}/tools/test_apps/system/test_api_check
test_nvs_coverage:
extends:
- .host_test_template