Skip to content

Commit 55fa0ed

Browse files
andreaskusterbblanchon
authored andcommitted
CI: added ESP-IDF component build (closes #1599)
1 parent 2455455 commit 55fa0ed

File tree

8 files changed

+1436
-1
lines changed

8 files changed

+1436
-1
lines changed

.github/workflows/ci.yml

+25
Original file line numberDiff line numberDiff line change
@@ -449,3 +449,28 @@ jobs:
449449
with:
450450
name: Single headers
451451
path: ${{ steps.amalgamate.outputs.filename }}
452+
453+
esp-idf:
454+
name: ESP-IDF
455+
runs-on: ubuntu-latest
456+
steps:
457+
- name: Setup cache
458+
uses: actions/cache@v2
459+
with:
460+
path: ~/.espressif
461+
key: ${{ runner.os }}-esp-idf
462+
- name: Checkout ArduinoJson
463+
uses: actions/checkout@v2
464+
- name: Checkout ESP-IDF
465+
uses: actions/checkout@v2
466+
with:
467+
repository: espressif/esp-idf
468+
path: esp-idf
469+
submodules: true
470+
- name: Install ESP-IDF
471+
run: ./esp-idf/install.sh
472+
- name: Build example
473+
run: |
474+
source esp-idf/export.sh
475+
cd extras/ci/espidf
476+
idf.py build

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ HEAD
1212
* Added support for `std::string_view` (issue #1578, PR #1554 by @0xFEEDC0DE64)
1313
* Fixed warning `definition of implicit copy constructor for 'MsgPackDeserializer' is deprecated because it has a user-declared copy assignment operator`
1414
* Added `JsonArray::clear()` (issue #1597)
15-
* Added support for ESP-IDF component build (PR #1562 by @qt1)
15+
* Added support for ESP-IDF component build (PR #1562 by @qt1, PR #1599 by @andreaskuster)
1616

1717
v6.18.0 (2021-05-05)
1818
-------

extras/ci/espidf/CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# ArduinoJson - https://arduinojson.org
2+
# Copyright Benoit Blanchon 2014-2021
3+
# MIT License
4+
5+
cmake_minimum_required(VERSION 3.5)
6+
7+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
8+
project(example)
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../..

extras/ci/espidf/main/CMakeLists.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# ArduinoJson - https://arduinojson.org
2+
# Copyright Benoit Blanchon 2014-2021
3+
# MIT License
4+
5+
idf_component_register(SRCS "main.cpp"
6+
INCLUDE_DIRS "")
7+
8+
# required to break possible dependency cycle
9+
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 3)

extras/ci/espidf/main/component.mk

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

extras/ci/espidf/main/main.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// ArduinoJson - https://arduinojson.org
2+
// Copyright Benoit Blanchon 2014-2021
3+
// MIT License
4+
5+
#include <ArduinoJson.h>
6+
7+
extern "C" void app_main() {
8+
char buffer[256];
9+
StaticJsonDocument<200> doc;
10+
11+
doc["hello"] = "world";
12+
serializeJson(doc, buffer);
13+
deserializeJson(doc, buffer);
14+
serializeMsgPack(doc, buffer);
15+
deserializeMsgPack(doc, buffer);
16+
}

0 commit comments

Comments
 (0)