Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,17 @@ jobs:
- name: Build
run: extras/ci/platformio.sh ${{ matrix.board }}

espidf:
name: ESP-IDF
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: install ESP-IDF
run: source extras/ci/espidf/install.sh
- name: build examples
run: source extras/ci/espidf.sh

particle:
name: Particle
needs: gcc
Expand Down
21 changes: 21 additions & 0 deletions extras/ci/espidf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

###############
# BUILD
###############

(
cd extras/ci/espidf || exit

# set env variables
. ./esp-idf/export.sh

(
# build all examples
for EXAMPLE in ./components/ArduinoJson/examples/*/*.ino; do
cp $EXAMPLE main/main.cpp
idf.py build || exit
done
)
)

6 changes: 6 additions & 0 deletions extras/ci/espidf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(hello-world)
2 changes: 2 additions & 0 deletions extras/ci/espidf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# ESP-IDF Continuous Integration Pipeline - Project Template

75 changes: 75 additions & 0 deletions extras/ci/espidf/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#!/bin/sh

###############
# INSTALLATION
###############

# change into root template directory
cd extras/ci/espidf || exit

echo "installing esp-idf..."
if [ ! -d "esp-idf" ] ; then
git clone https://github.com/espressif/esp-idf.git
fi
(
cd esp-idf || exit
git checkout 1d7068e4b
git submodule update --init --recursive
./install.sh
)

echo "esp-idf installed"

if [ ! -d "components" ] ; then
mkdir -p components
fi

echo "installing arduino-esp32"
(
cd components || exit
if [ ! -d "arduino" ] ; then
git clone https://github.com/espressif/arduino-esp32.git arduino
fi
(
cd arduino || exit
git checkout master #21947eb
git submodule update --init --recursive
)
)
echo "arduino-esp32 installed"

echo "installing ArduinoJson"
(
cd components || exit
if [ ! -d "ArduinoJson" ] ; then
git clone https://github.com/qt1/ArduinoJson.git
# TODO: must be switched (after PR merge) to: https://github.com/bblanchon/ArduinoJson.git
fi
(
cd ArduinoJson || exit
git checkout master
git submodule update --init --recursive
)
)
echo "ArduinoJson installed"

echo "installing Ethernet"
(
cd components || exit
if [ ! -d "Ethernet" ] ; then
git clone https://github.com/andreaskuster/Ethernet.git
# TODO: must be switched to (after PR merge): https://github.com/arduino-libraries/Ethernet.git
fi
(
cd Ethernet || exit
git checkout master
git submodule update --init --recursive
)
)
echo "Ethernet installed"

# set env variables
. ./esp-idf/export.sh

cd ../../..

5 changes: 5 additions & 0 deletions extras/ci/espidf/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
idf_component_register(SRCS "main.cpp"
INCLUDE_DIRS "")

# required to break possible dependency cycle
set_property(TARGET ${COMPONENT_LIB} APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 3)
4 changes: 4 additions & 0 deletions extras/ci/espidf/main/component.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#
# "main" pseudo-component makefile.
#
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)
Loading