Skip to content

Commit 6df1a14

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

File tree

8 files changed

+1434
-1
lines changed

8 files changed

+1434
-1
lines changed

.github/workflows/ci.yml

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

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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 "")

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)