CI: added ESP-IDF component build (closes #1599)

This commit is contained in:
Andreas Kuster
2021-06-25 13:49:11 +02:00
committed by Benoit Blanchon
parent cb2c029e57
commit 52e856fa6f
7 changed files with 62 additions and 1 deletions

View File

@ -449,3 +449,29 @@ jobs:
with: with:
name: Single headers name: Single headers
path: ${{ steps.amalgamate.outputs.filename }} 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

View File

@ -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` * 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) * Added `JsonArray::clear()` (issue #1597)
* Fixed `JsonVariant::as<unsigned>()` (issue #1601) * Fixed `JsonVariant::as<unsigned>()` (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) v6.18.0 (2021-05-05)
------- -------

View File

@ -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)

View File

@ -0,0 +1 @@
../../../..

View File

@ -0,0 +1,6 @@
# ArduinoJson - https://arduinojson.org
# Copyright Benoit Blanchon 2014-2021
# MIT License
idf_component_register(SRCS "main.cpp"
INCLUDE_DIRS "")

View File

@ -0,0 +1,4 @@
#
# "main" pseudo-component makefile.
#
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)

View File

@ -0,0 +1,16 @@
// ArduinoJson - https://arduinojson.org
// Copyright Benoit Blanchon 2014-2021
// MIT License
#include <ArduinoJson.h>
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);
}