From 5777e5e15dcd8169427e3bdceae7061e239ebd35 Mon Sep 17 00:00:00 2001 From: Gonzalo Nalbandian Date: Thu, 10 Apr 2025 12:53:05 -0300 Subject: [PATCH] Add CI for ESP-IDF example --- .github/workflows/ci.yml | 37 +++++++++++++++++++ CMakeLists.txt | 12 ++---- .../client/main/CMakeLists.txt | 3 +- 3 files changed, 42 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8740d5e7..dcc560e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,3 +102,40 @@ jobs: - run: PLATFORMIO_SRC_DIR=examples/Client PIO_BOARD=${{ matrix.board }} pio run -e ${{ matrix.env }} - run: PLATFORMIO_SRC_DIR=examples/FetchWebsite PIO_BOARD=${{ matrix.board }} pio run -e ${{ matrix.env }} + + esp-idf: + name: Build with ESP-IDF ${{ matrix.idf_ver }} for ${{ matrix.idf_target }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # The version names here correspond to the versions of espressif/idf Docker image. + # See https://hub.docker.com/r/espressif/idf/tags and + # https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-docker-image.html + # for details. + idf_ver: ["release-v5.4"] + idf_target: + [ + "esp32", + "esp32s2", + "esp32s3", + "esp32c2", + "esp32c3", + "esp32c6", + # "esp32h2", + "esp32p4" + ] + container: espressif/idf:${{ matrix.idf_ver }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: components/asynctcp + + - name: Build + env: + IDF_TARGET: ${{ matrix.idf_target }} + shell: bash + run: | + . ${IDF_PATH}/export.sh + idf.py -C ./components/asynctcp/idf_component_examples/client -DEXTRA_COMPONENT_DIRS=$PWD/components build diff --git a/CMakeLists.txt b/CMakeLists.txt index f19b3aad..1c7142bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,7 @@ -set(COMPONENT_SRCDIRS - "src" +idf_component_register( + SRCS "src/AsyncTCP.cpp" + INCLUDE_DIRS "src" + PRIV_REQUIRES esp_timer ) -set(COMPONENT_ADD_INCLUDEDIRS - "src" -) - -register_component() - target_compile_options(${COMPONENT_TARGET} PRIVATE -fno-rtti) diff --git a/idf_component_examples/client/main/CMakeLists.txt b/idf_component_examples/client/main/CMakeLists.txt index a6e0d37e..9ca01d0f 100644 --- a/idf_component_examples/client/main/CMakeLists.txt +++ b/idf_component_examples/client/main/CMakeLists.txt @@ -1,3 +1,2 @@ idf_component_register(SRCS "main.cpp" - INCLUDE_DIRS "." - PRIV_REQUIRES esp_timer) + INCLUDE_DIRS ".")