Skip to content

Commit 0f6bc44

Browse files
andreaskusterbblanchon
authored andcommitted
CI: added ESP-IDF (closes #1599)
1 parent af7a4b7 commit 0f6bc44

File tree

8 files changed

+1497
-0
lines changed

8 files changed

+1497
-0
lines changed

.github/workflows/ci.yml

+12
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,18 @@ jobs:
274274
if: ${{ always() }}
275275
run: platformio system prune -f
276276

277+
espidf:
278+
name: ESP-IDF
279+
needs: gcc
280+
runs-on: ubuntu-latest
281+
steps:
282+
- name: checkout
283+
uses: actions/checkout@v2
284+
- name: install ESP-IDF
285+
run: source extras/ci/espidf/install.sh
286+
- name: build examples
287+
run: source extras/ci/espidf.sh
288+
277289
particle:
278290
name: Particle
279291
needs: gcc

extras/ci/espidf.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
3+
###############
4+
# BUILD
5+
###############
6+
7+
(
8+
cd extras/ci/espidf || exit
9+
10+
# set env variables
11+
. ./esp-idf/export.sh
12+
13+
(
14+
# build all examples
15+
for EXAMPLE in ./components/ArduinoJson/examples/*/*.ino; do
16+
cp $EXAMPLE main/main.cpp
17+
idf.py build || exit
18+
done
19+
)
20+
)
21+

extras/ci/espidf/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# The following lines of boilerplate have to be in your project's
2+
# CMakeLists in this exact order for cmake to work correctly
3+
cmake_minimum_required(VERSION 3.5)
4+
5+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
6+
project(hello-world)

extras/ci/espidf/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# ESP-IDF Continuous Integration Pipeline - Project Template
2+

extras/ci/espidf/install.sh

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/sh
2+
3+
###############
4+
# INSTALLATION
5+
###############
6+
7+
# change into root template directory
8+
cd extras/ci/espidf || exit
9+
10+
echo "installing esp-idf..."
11+
if [ ! -d "esp-idf" ] ; then
12+
git clone https://github.com/espressif/esp-idf.git
13+
fi
14+
(
15+
cd esp-idf || exit
16+
git checkout 1d7068e4b
17+
git submodule update --init --recursive
18+
./install.sh
19+
)
20+
21+
echo "esp-idf installed"
22+
23+
if [ ! -d "components" ] ; then
24+
mkdir -p components
25+
fi
26+
27+
echo "installing arduino-esp32"
28+
(
29+
cd components || exit
30+
if [ ! -d "arduino" ] ; then
31+
git clone https://github.com/espressif/arduino-esp32.git arduino
32+
fi
33+
(
34+
cd arduino || exit
35+
git checkout master #21947eb
36+
git submodule update --init --recursive
37+
)
38+
)
39+
echo "arduino-esp32 installed"
40+
41+
echo "installing ArduinoJson"
42+
(
43+
cd components || exit
44+
if [ ! -d "ArduinoJson" ] ; then
45+
git clone https://github.com/qt1/ArduinoJson.git
46+
# TODO: must be switched (after PR merge) to: https://github.com/bblanchon/ArduinoJson.git
47+
fi
48+
(
49+
cd ArduinoJson || exit
50+
git checkout master
51+
git submodule update --init --recursive
52+
)
53+
)
54+
echo "ArduinoJson installed"
55+
56+
echo "installing Ethernet"
57+
(
58+
cd components || exit
59+
if [ ! -d "Ethernet" ] ; then
60+
git clone https://github.com/andreaskuster/Ethernet.git
61+
# TODO: must be switched to (after PR merge): https://github.com/arduino-libraries/Ethernet.git
62+
fi
63+
(
64+
cd Ethernet || exit
65+
git checkout master
66+
git submodule update --init --recursive
67+
)
68+
)
69+
echo "Ethernet installed"
70+
71+
# set env variables
72+
. ./esp-idf/export.sh
73+
74+
cd ../../..
75+

extras/ci/espidf/main/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
idf_component_register(SRCS "main.cpp"
2+
INCLUDE_DIRS "")
3+
4+
# required to break possible dependency cycle
5+
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.)

0 commit comments

Comments
 (0)