diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0810a37b..00bbb7da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -449,3 +449,29 @@ jobs: with: name: Single headers path: ${{ steps.amalgamate.outputs.filename }} + + esp-idf: + needs: gcc + name: ESP-IDF + runs-on: ubuntu-latest + steps: + - name: Setup cache + uses: actions/cache@v2 + with: + path: ~/.espressif + key: ${{ runner.os }}-esp-idf + - name: Checkout ArduinoJson + uses: actions/checkout@v2 + - name: Checkout ESP-IDF + uses: actions/checkout@v2 + with: + repository: espressif/esp-idf + path: esp-idf + submodules: true + - name: Install ESP-IDF + run: ./esp-idf/install.sh + - name: Build example + run: | + source esp-idf/export.sh + cd extras/ci/espidf + idf.py build diff --git a/CHANGELOG.md b/CHANGELOG.md index b519d913..74505817 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ HEAD * Fixed warning `definition of implicit copy constructor for 'MsgPackDeserializer' is deprecated because it has a user-declared copy assignment operator` * Added `JsonArray::clear()` (issue #1597) * Fixed `JsonVariant::as()` (issue #1601) -* Added support for ESP-IDF component build (PR #1562 by @qt1) +* Added support for ESP-IDF component build (PR #1562 by @qt1, PR #1599 by @andreaskuster) v6.18.0 (2021-05-05) ------- diff --git a/extras/ci/espidf/CMakeLists.txt b/extras/ci/espidf/CMakeLists.txt new file mode 100644 index 00000000..3932d3bc --- /dev/null +++ b/extras/ci/espidf/CMakeLists.txt @@ -0,0 +1,8 @@ +# ArduinoJson - https://arduinojson.org +# Copyright Benoit Blanchon 2014-2021 +# MIT License + +cmake_minimum_required(VERSION 3.5) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(example) diff --git a/extras/ci/espidf/components/ArduinoJson b/extras/ci/espidf/components/ArduinoJson new file mode 120000 index 00000000..c866b868 --- /dev/null +++ b/extras/ci/espidf/components/ArduinoJson @@ -0,0 +1 @@ +../../../.. \ No newline at end of file diff --git a/extras/ci/espidf/main/CMakeLists.txt b/extras/ci/espidf/main/CMakeLists.txt new file mode 100644 index 00000000..e501acda --- /dev/null +++ b/extras/ci/espidf/main/CMakeLists.txt @@ -0,0 +1,6 @@ +# ArduinoJson - https://arduinojson.org +# Copyright Benoit Blanchon 2014-2021 +# MIT License + +idf_component_register(SRCS "main.cpp" + INCLUDE_DIRS "") diff --git a/extras/ci/espidf/main/component.mk b/extras/ci/espidf/main/component.mk new file mode 100644 index 00000000..a98f634e --- /dev/null +++ b/extras/ci/espidf/main/component.mk @@ -0,0 +1,4 @@ +# +# "main" pseudo-component makefile. +# +# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) diff --git a/extras/ci/espidf/main/main.cpp b/extras/ci/espidf/main/main.cpp new file mode 100644 index 00000000..f3ec0004 --- /dev/null +++ b/extras/ci/espidf/main/main.cpp @@ -0,0 +1,16 @@ +// ArduinoJson - https://arduinojson.org +// Copyright Benoit Blanchon 2014-2021 +// MIT License + +#include + +extern "C" void app_main() { + char buffer[256]; + StaticJsonDocument<200> doc; + + doc["hello"] = "world"; + serializeJson(doc, buffer); + deserializeJson(doc, buffer); + serializeMsgPack(doc, buffer); + deserializeMsgPack(doc, buffer); +}