Skip to content

Commit 464cc36

Browse files
committed
fix(ci): Cleaned up the workflows
- Add all targets to esp-usb test apps and esp-idf examples - Fix override tinyusb in the network example
1 parent a8a3254 commit 464cc36

File tree

4 files changed

+84
-48
lines changed

4 files changed

+84
-48
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Config file for build_and_run_idf_examples.yml workflow
2+
3+
paths = [
4+
"${IDF_PATH}/examples/peripherals/usb/device", # ESP-IDF USB Device examples path
5+
]
6+
7+
exclude = [
8+
"${IDF_PATH}/examples/peripherals/usb/device/cherryusb_serial_device", # Exclude cherryusb-based device examples
9+
]
10+
11+
recursive = true
12+
manifest_file = "${IDF_PATH}/examples/peripherals/.build-test-rules.yml"
13+
check_warnings = true
14+
target = "all"
15+
16+
# Build related options (we need them to place build artifacts via target folders)
17+
build_dir = "build_@t_@w"

.github/workflows/build_and_run_esp_usb_test_apps.yml

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
name: ESP-USB Test Apps
1+
name: ESP-USB Test Apps [master]
2+
description: |
3+
This workflow builds and runs ESP-USB test applications for pull requests.
4+
It checks out the latest code from ESP-USB master, builds test apps using Espressif's IDF,
5+
uploads artifacts, and runs tests on self-hosted runners for supported targets.
26
37
on:
48
pull_request:
@@ -13,8 +17,12 @@ jobs:
1317
runs-on: ubuntu-latest
1418
container: espressif/idf:${{ matrix.idf_ver }}
1519
env:
16-
ESP_USB_MANIFEST: ./esp-usb/.build-test-rules.yml
17-
ESP_TINYUSB_TEST_APPS: ./esp-usb/device/esp_tinyusb/test_apps
20+
IDF_COMP_MAN_VER: "2.4.3"
21+
IDF_BUILD_APPS_VER: "2.13.1"
22+
ESP_USB_PATH: esp-usb
23+
ESP_USB_CONFIG_FILE: esp-usb/.idf_build_apps.toml
24+
ESP_USB_MANIFEST: esp-usb/.build-test-rules.yml
25+
ESP_TINYUSB_TEST_APPS: esp-usb/device/esp_tinyusb/test_apps
1826
steps:
1927
- uses: actions/checkout@v4
2028
with:
@@ -26,23 +34,23 @@ jobs:
2634
shell: bash
2735
run: |
2836
. ${IDF_PATH}/export.sh
29-
pip install --no-cache-dir idf-component-manager>=2.1.2 idf-build-apps==2.4.3 pyyaml --upgrade
37+
pip install --no-cache-dir idf-component-manager>=${{ env.IDF_COMP_MAN_VER }} idf-build-apps==${{ env.IDF_BUILD_APPS_VER }} pyyaml --upgrade
3038
export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
3139
export EXTRA_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes"
3240
export EXTRA_CXXFLAGS="${PEDANTIC_FLAGS}"
3341
python .github/ci/override_managed_component.py tinyusb . ${{ env.ESP_TINYUSB_TEST_APPS }}/*/
34-
idf-build-apps find --path ${{ env.ESP_TINYUSB_TEST_APPS }}/ --recursive --target esp32s2 --manifest-file ${{ env.ESP_USB_MANIFEST }}
35-
idf-build-apps build --path ${{ env.ESP_TINYUSB_TEST_APPS }}/ --recursive --target esp32s2 --manifest-file ${{ env.ESP_USB_MANIFEST }}
42+
idf-build-apps find --config-file ${{ env.ESP_USB_CONFIG_FILE }} -p ${{ env.ESP_TINYUSB_TEST_APPS }} --recursive -t esp32s2 --manifest-files ${{ env.ESP_USB_MANIFEST }} --manifest-rootpath ${{ env.ESP_USB_PATH }}
43+
idf-build-apps build --config-file ${{ env.ESP_USB_CONFIG_FILE }} -p ${{ env.ESP_TINYUSB_TEST_APPS }} --recursive -t esp32s2 --manifest-files ${{ env.ESP_USB_MANIFEST }} --manifest-rootpath ${{ env.ESP_USB_PATH }}
3644
- uses: actions/upload-artifact@v4
3745
with:
38-
name: usb_test_app_bin_${{ matrix.idf_ver }}
46+
name: usb_device_test_app_bin_${{ matrix.idf_ver }}
3947
path: |
40-
${{env.ESP_TINYUSB_TEST_APPS}}/**/build/bootloader/bootloader.bin
41-
${{env.ESP_TINYUSB_TEST_APPS}}/**/build/partition_table/partition-table.bin
42-
${{env.ESP_TINYUSB_TEST_APPS}}/**/build/test_app_*.bin
43-
${{env.ESP_TINYUSB_TEST_APPS}}/**/build/test_app_*.elf
44-
${{env.ESP_TINYUSB_TEST_APPS}}/**/build/flasher_args.json
45-
${{env.ESP_TINYUSB_TEST_APPS}}/**/build/config/sdkconfig.json
48+
**/build_esp*/bootloader/bootloader.bin
49+
**/build_esp*/partition_table/partition-table.bin
50+
**/build_esp*/test_app_*.bin
51+
**/build_esp*/test_app_*.elf
52+
**/build_esp*/flasher_args.json
53+
**/build_esp*/config/sdkconfig.json
4654
if-no-files-found: error
4755

4856
run-target:
@@ -53,13 +61,14 @@ jobs:
5361
matrix:
5462
idf_ver: ["release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "release-v5.5", "latest"]
5563
idf_target: ["esp32s2"]
64+
sdkconfig: ["default"]
5665
runner_tag: ["usb_device"]
5766
runs-on: [self-hosted, linux, docker, "${{ matrix.idf_target }}", "${{ matrix.runner_tag }}"]
5867
container:
5968
image: python:3.11-bookworm
6069
options: --privileged --device-cgroup-rule="c 188:* rmw" --device-cgroup-rule="c 166:* rmw"
6170
env:
62-
ESP_TINYUSB_TEST_APPS: ./esp-usb/device/esp_tinyusb/test_apps
71+
ESP_USB_PATH: esp-usb
6372
steps:
6473
- uses: actions/checkout@v4
6574
- name: Clone esp-usb repository
@@ -75,7 +84,8 @@ jobs:
7584
run: pip install --only-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pyserial pyusb
7685
- uses: actions/download-artifact@v4
7786
with:
78-
name: usb_test_app_bin_${{ matrix.idf_ver }}
79-
path: ${{env.ESP_TINYUSB_TEST_APPS}}
80-
- name: Run USB Test App on target
81-
run: pytest ${{env.ESP_TINYUSB_TEST_APPS}} --embedded-services esp,idf --target=${{ matrix.idf_target }} -m ${{ matrix.runner_tag }}
87+
name: usb_device_test_app_bin_${{ matrix.idf_ver }}
88+
- name: Run on target
89+
run: |
90+
cd ${{ env.ESP_USB_PATH }}
91+
pytest --target=${{ matrix.idf_target }} -m ${{ matrix.runner_tag }} --build-dir=build_${{ matrix.idf_target }}_${{ matrix.sdkconfig }}

.github/workflows/build_and_run_idf_examples.yml

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,51 +9,55 @@ jobs:
99
strategy:
1010
matrix:
1111
idf_ver: ["release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "release-v5.5", "latest"]
12-
fail-fast: false
1312
runs-on: ubuntu-latest
1413
container: espressif/idf:${{ matrix.idf_ver }}
14+
env:
15+
IDF_COMP_MAN_VER: "2.4.3"
16+
IDF_BUILD_APPS_VER: "2.13.1"
17+
CONFIG_PATH: ${{ github.workspace }}/.github/ci/.build_and_run_idf_examples_config.toml
1518
steps:
1619
- uses: actions/checkout@v4
1720
- name: Install Python dependencies
1821
shell: bash
1922
run: |
2023
. ${IDF_PATH}/export.sh
21-
pip install --no-cache-dir idf-component-manager>=2.1.2 idf-build-apps==2.4.3 pyyaml --upgrade
24+
pip install --no-cache-dir idf-component-manager>=${{ env.IDF_COMP_MAN_VER }} idf-build-apps==${{ env.IDF_BUILD_APPS_VER }} pyyaml --upgrade
2225
- name: Build Network USB related examples
2326
shell: bash
2427
run: |
2528
. ${IDF_PATH}/export.sh
29+
# Hint: To build network example we just use default config and network build rules provided by IDF
2630
export EXAMPLES_PATH="${IDF_PATH}/examples/network/sta2eth"
2731
export MANIFEST_FILE="${IDF_PATH}/examples/network/.build-test-rules.yml"
28-
idf-build-apps find --path ${EXAMPLES_PATH}/ --target esp32s2 --manifest-file ${MANIFEST_FILE}
29-
idf-build-apps build --path ${EXAMPLES_PATH}/ --target esp32s2 --manifest-file ${MANIFEST_FILE}
32+
python .github/ci/override_managed_component.py tinyusb . ${EXAMPLES_PATH}
33+
idf-build-apps find -p ${EXAMPLES_PATH} -t esp32s2 --manifest-files ${MANIFEST_FILE} --manifest-rootpath ${IDF_PATH}
34+
idf-build-apps build -p ${EXAMPLES_PATH} -t esp32s2 --manifest-files ${MANIFEST_FILE} --manifest-rootpath ${IDF_PATH}
3035
- name: Build USB Device examples
3136
shell: bash
3237
run: |
3338
. ${IDF_PATH}/export.sh
34-
export EXAMPLES_PATH="${IDF_PATH}/examples/peripherals/usb/device"
35-
export MANIFEST_FILE="${IDF_PATH}/examples/peripherals/.build-test-rules.yml"
36-
python .github/ci/override_managed_component.py tinyusb . ${EXAMPLES_PATH}/tusb_*
37-
idf-build-apps find --path ${EXAMPLES_PATH}/ --recursive --target esp32s2 --manifest-file ${MANIFEST_FILE}
38-
idf-build-apps build --path ${EXAMPLES_PATH}/ --recursive --target esp32s2 --manifest-file ${MANIFEST_FILE}
39+
python .github/ci/override_managed_component.py tinyusb . ${IDF_PATH}/examples/peripherals/usb/device/tusb_*
40+
idf-build-apps find --config-file ${CONFIG_PATH} --manifest-rootpath ${IDF_PATH}
41+
idf-build-apps build --config-file ${CONFIG_PATH} --manifest-rootpath ${IDF_PATH}
3942
- uses: actions/upload-artifact@v4
43+
env:
44+
IDF_ROOT: "/opt/esp/idf"
4045
with:
4146
# We upload only the USB Device example binaries to run them on the target
42-
name: usb_device_tusb_apps_bin_${{ matrix.idf_ver }}
47+
name: usb_device_examples_bin_${{ matrix.idf_ver }}
4348
path: |
44-
/opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/bootloader/bootloader.bin
45-
/opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/partition_table/partition-table.bin
46-
/opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/tusb_*.bin
47-
/opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/tusb_*.elf
48-
/opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/flasher_args.json
49-
/opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/config/sdkconfig.json
49+
${{ env.IDF_ROOT }}/**/build_esp*/bootloader/bootloader.bin
50+
${{ env.IDF_ROOT }}/**/build_esp*/partition_table/partition-table.bin
51+
${{ env.IDF_ROOT }}/**/build_esp*/tusb_*.bin
52+
${{ env.IDF_ROOT }}/**/build_esp*/tusb_*.elf
53+
${{ env.IDF_ROOT }}/**/build_esp*/flasher_args.json
54+
${{ env.IDF_ROOT }}/**/build_esp*/config/sdkconfig.json
5055
if-no-files-found: error
5156
run-target:
52-
name: Run USB Device examples
57+
name: Run
5358
if: ${{ github.repository_owner == 'espressif' }}
5459
needs: build
5560
strategy:
56-
fail-fast: false
5761
matrix:
5862
idf_ver: ["release-v5.3", "release-v5.4", "release-v5.5" , "latest"]
5963
idf_target: ["esp32s2"]
@@ -62,6 +66,8 @@ jobs:
6266
container:
6367
image: espressif/idf:${{ matrix.idf_ver }}
6468
options: --privileged --device-cgroup-rule="c 188:* rmw" --device-cgroup-rule="c 166:* rmw"
69+
env:
70+
IDF_ROOT: "/opt/esp/idf"
6571
steps:
6672
- name: ⚙️ Install System tools
6773
run: |
@@ -75,12 +81,13 @@ jobs:
7581
. ./export.sh
7682
pip install --no-cache-dir --only-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-jtag pytest-embedded-idf pyserial pyusb python-gitlab minio idf-build-apps idf_ci pytest_ignore_test_results pytest-timeout netifaces
7783
- uses: actions/download-artifact@v4
84+
env:
85+
IDF_ROOT: "/opt/esp/idf"
7886
with:
79-
name: usb_device_tusb_apps_bin_${{ matrix.idf_ver }}
80-
path: /opt/esp/idf/examples/peripherals/usb/device
81-
- name: Run USB Test App on target
87+
name: usb_device_examples_bin_${{ matrix.idf_ver }}
88+
path: ${{ env.IDF_ROOT }}
89+
- name: Run on target
8290
run: |
8391
cd ${IDF_PATH}
8492
. ./export.sh
85-
export EXAMPLES_PATH="${IDF_PATH}/examples/peripherals/usb/device"
86-
pytest ${EXAMPLES_PATH} --target ${{ matrix.idf_target }} -m ${{ matrix.runner_tag }} --ignore-result-cases=*ncm_example
93+
pytest --target ${{ matrix.idf_target }} -m ${{ matrix.runner_tag }} --ignore-result-cases=*ncm_example --build-dir=build_${{ matrix.idf_target }}

.github/workflows/build_iot_examples.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ jobs:
1313
runs-on: ubuntu-latest
1414
container: espressif/idf:${{ matrix.idf_ver }}
1515
env:
16-
ESP_IOT_PATH: esp-iot-solution
17-
MANIFEST_PATH: esp-iot-solution/examples/.build-rules.yml
18-
EXAMPLE_PATH: esp-iot-solution/examples/usb/device/${{ matrix.name }}
16+
IDF_COMP_MAN_VER: "2.4.3"
17+
IDF_BUILD_APPS_VER: "2.13.1"
18+
TARGET_PATH: esp-iot-solution
19+
TARGET_MANIFEST_PATH: esp-iot-solution/examples/.build-rules.yml
20+
TARGET_EXAMPLES_PATH: esp-iot-solution/examples/usb/device/${{ matrix.name }}
1921
steps:
2022
- uses: actions/checkout@v4
2123
with:
@@ -27,7 +29,7 @@ jobs:
2729
shell: bash
2830
run: |
2931
. ${IDF_PATH}/export.sh
30-
pip install --no-cache-dir idf-component-manager>=2.1.2 idf-build-apps==2.4.3 pyyaml --upgrade
31-
python .github/ci/override_managed_component.py tinyusb . ${{ env.EXAMPLE_PATH }}/
32-
idf-build-apps find --paths ${{ env.EXAMPLE_PATH }} --target all --manifest-file ${{ env.MANIFEST_PATH }} --manifest-rootpath ${{ env.ESP_IOT_PATH }}
33-
idf-build-apps build --paths ${{ env.EXAMPLE_PATH }} --target all --manifest-file ${{ env.MANIFEST_PATH }} --manifest-rootpath ${{ env.ESP_IOT_PATH }}
32+
pip install --no-cache-dir idf-component-manager>=${{ env.IDF_COMP_MAN_VER }} idf-build-apps==${{ env.IDF_BUILD_APPS_VER }} pyyaml --upgrade
33+
python .github/ci/override_managed_component.py tinyusb . ${{ env.TARGET_EXAMPLES_PATH }}/
34+
idf-build-apps find -p ${{ env.TARGET_EXAMPLES_PATH }} -t all --manifest-file ${{ env.TARGET_MANIFEST_PATH }} --manifest-rootpath ${{ env.TARGET_PATH }}
35+
idf-build-apps build -p ${{ env.TARGET_EXAMPLES_PATH }} -t all --manifest-file ${{ env.TARGET_MANIFEST_PATH }} --manifest-rootpath ${{ env.TARGET_PATH }}

0 commit comments

Comments
 (0)