77jobs :
88 build :
99 strategy :
10+ fail-fast : false
1011 matrix :
1112 idf_ver : ["release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "release-v5.5", "latest"]
12- fail-fast : false
1313 runs-on : ubuntu-latest
1414 container : espressif/idf:${{ matrix.idf_ver }}
15+ env :
16+ IDF_COMP_MAN_VER : " 2.4.3"
17+ IDF_BUILD_APPS_VER : " 2.13.1"
18+ CONFIG_PATH : ${{ github.workspace }}/.github/ci/.build_and_run_idf_examples_config.toml
1519 steps :
1620 - uses : actions/checkout@v4
1721 - name : Install Python dependencies
1822 shell : bash
1923 run : |
2024 . ${IDF_PATH}/export.sh
21- pip install --no-cache-dir idf-component-manager>=2.1.2 idf-build-apps==2.4.3 pyyaml --upgrade
25+ pip install --no-cache-dir idf-component-manager>=${{ env.IDF_COMP_MAN_VER }} idf-build-apps==${{ env.IDF_BUILD_APPS_VER }} pyyaml --upgrade
2226 - name : Build Network USB related examples
2327 shell : bash
2428 run : |
2529 . ${IDF_PATH}/export.sh
30+ # Hint: To build network example we just use default config and network build rules provided by IDF
2631 export EXAMPLES_PATH="${IDF_PATH}/examples/network/sta2eth"
2732 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}
33+ python .github/ci/override_managed_component.py tinyusb . ${EXAMPLES_PATH}
34+ idf-build-apps find -p ${EXAMPLES_PATH} -t esp32s2 --manifest-files ${MANIFEST_FILE} --manifest-rootpath ${IDF_PATH}
35+ idf-build-apps build -p ${EXAMPLES_PATH} -t esp32s2 --manifest-files ${MANIFEST_FILE} --manifest-rootpath ${IDF_PATH}
3036 - name : Build USB Device examples
3137 shell : bash
3238 run : |
3339 . ${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}
40+ python .github/ci/override_managed_component.py tinyusb . ${IDF_PATH}/examples/peripherals/usb/device/tusb_*
41+ idf-build-apps find --config-file ${CONFIG_PATH} --manifest-rootpath ${IDF_PATH}
42+ idf-build-apps build --config-file ${CONFIG_PATH} --manifest-rootpath ${IDF_PATH}
3943 - uses : actions/upload-artifact@v4
44+ env :
45+ IDF_ROOT : " /opt/esp/idf"
4046 with :
41- # 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+ # We upload only USB Device example binaries to run them on the target
48+ name : usb_device_examples_bin_ ${{ matrix.idf_ver }}
4349 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
50+ ${{ env.IDF_ROOT }}/**/build_esp* /bootloader/bootloader.bin
51+ ${{ env.IDF_ROOT }}/**/build_esp* /partition_table/partition-table.bin
52+ ${{ env.IDF_ROOT }}/**/build_esp* /tusb_*.bin
53+ ${{ env.IDF_ROOT }}/**/build_esp* /tusb_*.elf
54+ ${{ env.IDF_ROOT }}/**/build_esp* /flasher_args.json
55+ ${{ env.IDF_ROOT }}/**/build_esp* /config/sdkconfig.json
5056 if-no-files-found : error
5157 run-target :
52- name : Run USB Device examples
58+ name : Run
59+ # Disable the job in forks
5360 if : ${{ github.repository_owner == 'espressif' }}
5461 needs : build
5562 strategy :
5663 fail-fast : false
5764 matrix :
65+ # Run esp-idf examples, starting from v5.3
5866 idf_ver : ["release-v5.3", "release-v5.4", "release-v5.5" , "latest"]
5967 idf_target : ["esp32s2"]
6068 runner_tag : ["usb_device"]
6169 runs-on : [self-hosted, linux, docker, "${{ matrix.idf_target }}", "${{ matrix.runner_tag }}"]
6270 container :
71+ # We run on espressif/idf image as we need the code of examples to be present to run pytest
6372 image : espressif/idf:${{ matrix.idf_ver }}
6473 options : --privileged --device-cgroup-rule="c 188:* rmw" --device-cgroup-rule="c 166:* rmw"
74+ env :
75+ # We do not use ${IDF_PATH} here, because it is not available during download of artifacts step
76+ IDF_ROOT : " /opt/esp/idf"
77+ IDF_EXAMPLES_PATH : " ${IDF_PATH}/examples/peripherals/usb/device"
6578 steps :
6679 - name : ⚙️ Install System tools
6780 run : |
@@ -71,16 +84,15 @@ jobs:
7184 env :
7285 PIP_EXTRA_INDEX_URL : " https://dl.espressif.com/pypi/"
7386 run : |
74- cd ${IDF_PATH}
75- . ./export.sh
87+ . ${IDF_PATH}/export.sh
7688 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
7789 - uses : actions/download-artifact@v4
7890 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
91+ # Need to set the path manually.
92+ # The examples were built on a system files, which are not under the repository.
93+ name : usb_device_examples_bin_${{ matrix.idf_ver }}
94+ path : ${{ env.IDF_ROOT }}
95+ - name : Run on target
8296 run : |
83- cd ${IDF_PATH}
84- . ./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
97+ . ${IDF_PATH}/export.sh
98+ pytest ${{ env.IDF_EXAMPLES_PATH }} --target ${{ matrix.idf_target }} -m ${{ matrix.runner_tag }} --ignore-result-cases=*ncm_example --build-dir=build_${{ matrix.idf_target }}
0 commit comments