From 3c4828c65c5afd08fa73fb8232aa84b8baa2c72c Mon Sep 17 00:00:00 2001 From: Roman Leonov Date: Tue, 21 Jan 2025 10:41:32 +0100 Subject: [PATCH] ci(workflow): Added build network examples to CI --- .github/ci/override_managed_component.py | 8 ++++++- .github/workflows/build_idf_examples.yml | 30 ++++++++++++++++++++---- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/.github/ci/override_managed_component.py b/.github/ci/override_managed_component.py index bae24680..ee9da398 100755 --- a/.github/ci/override_managed_component.py +++ b/.github/ci/override_managed_component.py @@ -1,12 +1,13 @@ #!/usr/bin/env python # -# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 import sys import argparse from pathlib import Path from glob import glob +from os import path from idf_component_tools.manifest import ManifestManager @@ -47,6 +48,11 @@ def override_with_local_component_all(component, local_path, apps): # Go through all collected apps for app in apps_with_glob: + # Verify that the app is a valid directory + if not path.isdir(app): + print(f"[Warning] Skipping app '{app}' as it is not a valid directory.") + continue # Skip to the next app + # Process the app if it's a directory try: override_with_local_component(component, local_path, app) except: diff --git a/.github/workflows/build_idf_examples.yml b/.github/workflows/build_idf_examples.yml index 8d3c10db..939521e5 100644 --- a/.github/workflows/build_idf_examples.yml +++ b/.github/workflows/build_idf_examples.yml @@ -1,4 +1,4 @@ -name: Build ESP-IDF USB examples +name: ESP-IDF Examples on: schedule: @@ -11,18 +11,38 @@ jobs: strategy: matrix: idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "latest"] + target: ["esp32s2", "esp32s3", "esp32p4"] + example: + - { name: "USB Device", path: "examples/peripherals/usb/device", manifest_path: "examples/peripherals"} + - { name: "Network", path: "examples/network", manifest_path: "examples/network" } + exclude: + # Exclude esp32p4 for releases before IDF 5.3 (esp32p4 support starts in IDF 5.3) + - idf_ver: "release-v5.0" + target: "esp32p4" + - idf_ver: "release-v5.1" + target: "esp32p4" + - idf_ver: "release-v5.2" + target: "esp32p4" + # Exclude esp32p4 for Network examples + - target: "esp32p4" + example: { name: "Network", path: "examples/network", manifest_path: "examples/network" } + # Exclude Network examples for releases IDF 5.0 and 5.1 + - example: { name: "Network", path: "examples/network", manifest_path: "examples/network" } + idf_ver: "release-v5.0" + - example: { name: "Network", path: "examples/network", manifest_path: "examples/network" } + idf_ver: "release-v5.1" runs-on: ubuntu-20.04 container: espressif/idf:${{ matrix.idf_ver }} steps: - uses: actions/checkout@v4 with: submodules: 'true' - - name: Build ESP-IDF USB examples + - name: Build shell: bash run: | . ${IDF_PATH}/export.sh pip install idf-component-manager==1.5.2 idf-build-apps==2.4.3 --upgrade - python .github/ci/override_managed_component.py esp_tinyusb device/esp_tinyusb ${IDF_PATH}/examples/peripherals/usb/device/tusb_* + python .github/ci/override_managed_component.py esp_tinyusb device/esp_tinyusb ${IDF_PATH}/${{ matrix.example.path }}/* cd ${IDF_PATH} - idf-build-apps find --path examples/peripherals/usb/device/ --recursive --target all --manifest-file examples/peripherals/.build-test-rules.yml --build-dir build_@t_@w --work-dir @f_@t_@w - idf-build-apps build --path examples/peripherals/usb/device/ --recursive --target all --manifest-file examples/peripherals/.build-test-rules.yml --build-dir build_@t_@w --work-dir @f_@t_@w + idf-build-apps find --path ${{ matrix.example.path }} --recursive --target ${{ matrix.target }} --manifest-file ${{ matrix.example.manifest_path }}/.build-test-rules.yml --build-dir build_@t_@w --work-dir @f_@t_@w + idf-build-apps build --path ${{ matrix.example.path }} --recursive --target ${{ matrix.target }} --manifest-file ${{ matrix.example.manifest_path }}/.build-test-rules.yml --build-dir build_@t_@w --work-dir @f_@t_@w