Skip to content

feat(ci): Run esp-idf examples on targets#337

Merged
peter-marcisovsky merged 1 commit intomasterfrom
ci/target_run_idf_examples
Jan 7, 2026
Merged

feat(ci): Run esp-idf examples on targets#337
peter-marcisovsky merged 1 commit intomasterfrom
ci/target_run_idf_examples

Conversation

@peter-marcisovsky
Copy link
Collaborator

@peter-marcisovsky peter-marcisovsky commented Nov 26, 2025

Description

Running esp-idf usb host and usb device examples with overridden local components on target runners.

Related

Limitations

  • NCM Device examples can't be currently run on GH Runners
    • docker container must be executed with --net=host option (same as it is done on GL runners where the NCM device tests are passing) to access host network interface, not possible due to default GH runners config
    • the solution is tested locally and working
  • idf examples for IDF 5.4 and older releases are not run, due to complicated CI setup
    • in GL CI, there is a dedicated container target-test-env for this purpose

Changes

Target runners

  • usb_device target runners in esp-usb run esp-idf device examples
  • usb_host_flash_disk target runners in esp-usb run esp-idf host examples

Conditional workflow run

  • the build_and_run_idf_examples.yml workflow run conditionally specified by the PR author
  • to save some CI build time, as this test don't have to be build for every PR
  • the workflow runs if a PR label BUILD_AND_TEST_IDF_EXAMPLES is present - user can add this label to trigger the run

Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

Note

Runs esp-idf USB host/device examples on hardware with artifact-based handoff between build and run jobs, and introduces centralized example-selection rules.

  • Adds .github/ci/.idf-build-examples-rules.yml to enable/disable usb examples (notably enables host/uvc for IDF_VERSION >= 5.5; disables when SOC_USB_OTG_SUPPORTED != 1, and for NCM also when SOC_WIFI_SUPPORTED != 1).
  • Reworks build_and_run_idf_examples.yml to:
    • Gate execution via BUILD_AND_TEST_IDF_EXAMPLES label; build matrix for IDF 5.2–latest; upload build artifacts.
    • Always override esp_tinyusb for device and override host class/usb components as appropriate; create idf_component.yml for usb_host_lib on <6.0.
    • New "run" job on self-hosted runners (esp32s2, esp32p4) for IDF ≥5.5; excludes esp32p4 on some versions; installs deps and executes pytest with markers.
  • Minor CI hygiene in build_and_run_test_app_usb.yml: switch to apt-get and add --no-cache-dir to pip installs.

Written by Cursor Bugbot for commit 96b07e8. This will update automatically on new commits. Configure here.

@peter-marcisovsky peter-marcisovsky self-assigned this Nov 26, 2025
@peter-marcisovsky peter-marcisovsky added Status: In Progress Issue is being worked on CI CI related PR labels Nov 26, 2025
@peter-marcisovsky peter-marcisovsky force-pushed the ci/target_run_idf_examples branch 2 times, most recently from a1d7fe5 to 73b88d9 Compare November 27, 2025 11:44
@peter-marcisovsky
Copy link
Collaborator Author

peter-marcisovsky commented Nov 27, 2025

The CI workflow correctly accessed esp32p4 usb_host_flash_disk runners, but there is the error about esp32p4 ECO versions mismatch on the esp-idf Latest :

esptool.util.FatalError: '/opt/esp/idf/examples/peripherals/usb/host/usb_host_lib/build_esp32p4_default/bootloader/bootloader.bin' requires chip revision in range [v3.0 - v3.99] (this chip is revision v1.0). Use the force argument to flash anyway.

Build is for esp32p4 ECO5, the runners are not ECO5.
Disabling the esp32p4 usb_host_flash_disk run for esp-idf latest until the new runners are avaliable.

@peter-marcisovsky peter-marcisovsky force-pushed the ci/target_run_idf_examples branch 2 times, most recently from 44dbe6c to 2821fb2 Compare November 28, 2025 09:46
@peter-marcisovsky peter-marcisovsky added BUILD_AND_TEST_IDF_EXAMPLES Build and run esp-idf usb host and device examples in PR and removed BUILD_AND_TEST_IDF_EXAMPLES Build and run esp-idf usb host and device examples in PR labels Nov 28, 2025
@peter-marcisovsky peter-marcisovsky changed the title feat(ci): Run esp-idf examples on targets feat(ci): Run esp-idf examples on targets release Nov 28, 2025
@peter-marcisovsky peter-marcisovsky changed the title feat(ci): Run esp-idf examples on targets release feat(ci): Run esp-idf examples on targets Nov 28, 2025
@peter-marcisovsky peter-marcisovsky force-pushed the ci/target_run_idf_examples branch from a0c721e to 8f7a8ec Compare November 28, 2025 10:11
@peter-marcisovsky peter-marcisovsky added the BUILD_AND_TEST_IDF_EXAMPLES Build and run esp-idf usb host and device examples in PR label Nov 28, 2025
@peter-marcisovsky peter-marcisovsky force-pushed the ci/target_run_idf_examples branch 3 times, most recently from d77c06b to 69a797c Compare November 28, 2025 10:26
@peter-marcisovsky peter-marcisovsky marked this pull request as ready for review November 28, 2025 10:58
@peter-marcisovsky peter-marcisovsky force-pushed the ci/target_run_idf_examples branch 2 times, most recently from 95ec11b to 3303766 Compare November 28, 2025 12:40
@peter-marcisovsky peter-marcisovsky added Status: Reviewing Issue is being reviewed and removed Status: In Progress Issue is being worked on labels Nov 28, 2025
@peter-marcisovsky peter-marcisovsky force-pushed the ci/target_run_idf_examples branch from 3303766 to 5c73605 Compare December 4, 2025 09:20
@peter-marcisovsky peter-marcisovsky marked this pull request as draft December 9, 2025 08:37
@peter-marcisovsky
Copy link
Collaborator Author

Converted to draft, as the github runners are failing to run ncm device tests. Will fix this issue in another PR

@peter-marcisovsky peter-marcisovsky added Status: In Progress Issue is being worked on and removed Status: Reviewing Issue is being reviewed labels Dec 9, 2025
@peter-marcisovsky peter-marcisovsky force-pushed the ci/target_run_idf_examples branch from b380cc2 to b3f015d Compare December 12, 2025 16:06
@peter-marcisovsky peter-marcisovsky force-pushed the ci/target_run_idf_examples branch from b3f015d to 14abf5b Compare December 15, 2025 13:58
@peter-marcisovsky peter-marcisovsky force-pushed the ci/target_run_idf_examples branch from 14abf5b to 31e5567 Compare December 15, 2025 14:50
@peter-marcisovsky peter-marcisovsky force-pushed the ci/target_run_idf_examples branch from 31e5567 to 59a5e28 Compare December 15, 2025 17:17
@peter-marcisovsky peter-marcisovsky force-pushed the ci/target_run_idf_examples branch from 59a5e28 to a32c21a Compare December 16, 2025 12:34
@peter-marcisovsky peter-marcisovsky force-pushed the ci/target_run_idf_examples branch from a32c21a to c08e69f Compare December 17, 2025 11:23
@peter-marcisovsky peter-marcisovsky force-pushed the ci/target_run_idf_examples branch from c08e69f to f814361 Compare December 17, 2025 13:16
@peter-marcisovsky peter-marcisovsky marked this pull request as ready for review December 17, 2025 13:17
@peter-marcisovsky peter-marcisovsky added Status: Reviewing Issue is being reviewed and removed Status: In Progress Issue is being worked on labels Dec 17, 2025
@peter-marcisovsky
Copy link
Collaborator Author

@tore-espressif @igi540
PR is (again) ready, after solving all the ci setup issues. PTAL

@peter-marcisovsky
Copy link
Collaborator Author

esp-idf device examples backports to use esp_tinyusb v 2.x.x merged in all IDF releases CI passed, ready for merge.

Copy link
Collaborator

@igi540 igi540 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I left few nitpicks in the inline comments.

@peter-marcisovsky peter-marcisovsky force-pushed the ci/target_run_idf_examples branch 2 times, most recently from eaf7947 to be03ba6 Compare January 7, 2026 09:46
Copy link
Collaborator

@tore-espressif tore-espressif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@peter-marcisovsky LGTM, just one comment that could make it a little cleaner

@peter-marcisovsky peter-marcisovsky removed the BUILD_AND_TEST_IDF_EXAMPLES Build and run esp-idf usb host and device examples in PR label Jan 7, 2026
    - build and run esp-idf device and host examples
    - conditional run of the workflow
@peter-marcisovsky
Copy link
Collaborator Author

@tore-espressif the --ignore-result-cases implemented as suggested.

FYI I added back the conditional run, which I lost somewhere during rebasing I guess 😕 Just this two lines. And updated the label name to align with your label to run all test apps.

So the conditional run is only based on this label, not on both the label and PR name as I had it before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BUILD_AND_TEST_IDF_EXAMPLES Build and run esp-idf usb host and device examples in PR CI CI related PR Status: Done Issue is done internally

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants