Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/ci/.idf-build-examples-rules.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
# Manifest file for build_idf_examples.yml CI workflow

examples/peripherals/usb/device:
enable:
- if: (IDF_VERSION >= "6.0.0")
reason: Device examples have been updated to use esp_tinyusb 2.x only on esp-idf latest for now, TODO IDF-14282
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This limitation is partially removed and moved to the build_and_run_idf_examples.yml

As the esp_tinyusb 2.x support is being backported to all the releases, but not all the MR are merged. We will override the local esp_tinyusb component for:

  • IDF 6.1
  • IDF 6.0
  • IDF 5.5
  • IDF 5.3

For the rest of the releases, the device examples in esp-idf will be run with managed components.

disable:
- if: SOC_USB_OTG_SUPPORTED != 1

examples/peripherals/usb/device/tusb_ncm:
enable:
- if: (IDF_VERSION >= "6.0.0")
reason: Device examples have been updated to use esp_tinyusb 2.x only on esp-idf latest for now, TODO IDF-14282
disable:
- if: SOC_USB_OTG_SUPPORTED != 1 or SOC_WIFI_SUPPORTED != 1

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# This workflow builds esp-idf examples:
# This workflow builds and runs usb host and usb device esp-idf examples with overridden local components:
#
# Build:
# - usb device examples: with overridden esp_tinyusb from esp-usb/device/esp_tinyusb
# - Override esp_tinyusb component only for IDF >= 6.0 temporarily
# - Override esp_tinyusb component only for IDF 5.1, IDF 5.3, IDF 5.5, IDF 6.0 and latest temporarily, others have not been backported
#
# - usb host examples:
# - Overridden usb component from esp-usb/host/usb and overridden class drivers from esp-usb/host/class
Expand All @@ -11,15 +12,32 @@
#
# - cherryusb examples are ignored
# - usb_host_lib example -> manifest file must be created for IDF < 6.0 to override usb component
#
# Run:
# - usb device examples: Run on usb_device target runners, with matrix of all listed releases
# - usb host examples: Run on usb_host_examples target runners, with matrix of all listed releases, except IDF Latest, IDF 6.0 and IDF 5.1
#
#
# Temporarily disabled tests and TODOs of this workflow:
# - USB Device examples build: Only for only for IDF 5.1, IDF 5.3, IDF 5.5, IDF 6.0 and latest temporarily, others have not been backported
# - USB Host examples run: IDF latest and IDF 6.0 disabled (ECO4-ECO5 build-runner mismatch)
# - USB Device examples run: IDF latest and IDF 6.0 disabled (ECO4-ECO5 build-runner mismatch)
# - USB Device NCM example: Disabled due to GH Runner configuration (docker needs --net=host to access host network namespace)

name: Build ESP-IDF USB examples
name: Build and Run ESP-IDF USB examples

on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
build:
# Condition:
# 1. PR title contains "release" (case-sensitive)
# 2. PR labels include "tests esp-idf"
if: |
contains(github.event.pull_request.title, 'release') ||
contains(github.event.pull_request.labels.*.name, 'tests esp-idf')
strategy:
fail-fast: true
matrix:
Expand Down Expand Up @@ -51,8 +69,8 @@ jobs:
- name: Setup IDF Examples path
run: echo "EXAMPLES_PATH=${IDF_PATH}/examples/peripherals/usb" >> $GITHUB_ENV
- name: Override device component
# Override esp_tinyusb component only for IDF >= 6.0 temporarily
if: contains('release-v6.0 latest', matrix.idf_ver)
# Override esp_tinyusb component only for IDF 5.1, IDF 5.3, IDF 5.5, IDF 6.0 and latest temporarily, others have not been backported
if: contains('release-v5.1 release-v5.3 release-v5.5 release-v6.0 latest', matrix.idf_ver)
run: |
. ${IDF_PATH}/export.sh
python .github/ci/override_managed_component.py esp_tinyusb device/esp_tinyusb ${{ env.EXAMPLES_PATH }}/device/*
Expand Down Expand Up @@ -126,3 +144,87 @@ jobs:

idf-build-apps find --config-file ${CONFIG_PATH} --manifest-file ${MANIFEST_PATH}
idf-build-apps build --config-file ${CONFIG_PATH} --manifest-file ${MANIFEST_PATH}

- uses: actions/upload-artifact@v4
# Upload build files, pytest files and sdkconfig files
with:
name: usb_examples_bin_${{ matrix.idf_ver }}
path: |
${{ env.EXAMPLES_PATH }}/**/build_esp*/bootloader/bootloader.bin
${{ env.EXAMPLES_PATH }}/**/build_esp*/partition_table/partition-table.bin
${{ env.EXAMPLES_PATH }}/**/build_esp*/*.bin
${{ env.EXAMPLES_PATH }}/**/build_esp*/*.elf
${{ env.EXAMPLES_PATH }}/**/build_esp*/flasher_args.json
${{ env.EXAMPLES_PATH }}/**/build_esp*/config/sdkconfig.json
${{ env.EXAMPLES_PATH }}/**/pytest_*.py
${{ env.EXAMPLES_PATH }}/**/sdkconfig.*
if-no-files-found: error

run-target:
name: Run esp-idf examples
if: ${{ github.repository_owner == 'espressif' }}
needs: build
strategy:
fail-fast: true
matrix:
idf_ver:
[
"release-v5.1",
"release-v5.2",
"release-v5.3",
"release-v5.4",
"release-v5.5",
"release-v6.0",
"latest",
]
idf_target: ["esp32s2", "esp32p4"]
runner_tag: ["usb_host_flash_disk", "usb_device"]
include:
# Assign a folder structure to a target runner
- runner_tag: usb_host_flash_disk
example: host
- runner_tag: usb_device
example: device
exclude:
# Exclude esp32p4 for releases before IDF 5.3 for all runner tags (esp32p4 support starts in IDF 5.3)
- idf_ver: "release-v5.1"
idf_target: "esp32p4"
- idf_ver: "release-v5.2"
idf_target: "esp32p4"
# Exclude usb host examples run for IDF 5.1 - No pytest for host examples yet used
- idf_ver: "release-v5.1"
runner_tag: usb_host_flash_disk
# Temp exclude esp32p4 usb_host_flash_disk run for IDF Latest and 6.0 (ECO4-ECO5 build-runner mismatch)
- runner_tag: usb_host_flash_disk
idf_ver: "latest"
- runner_tag: usb_host_flash_disk
idf_ver: "release-v6.0"
- runner_tag: usb_device
idf_ver: "latest"
- runner_tag: usb_device
idf_ver: "release-v6.0"
runs-on: [self-hosted, linux, docker, "${{ matrix.idf_target }}", "${{ matrix.runner_tag }}"]
container:
image: python:3.11-bookworm
options: --privileged --device-cgroup-rule="c 188:* rmw" --device-cgroup-rule="c 166:* rmw"
env:
EXAMPLES_PATH: ${{ github.workspace }}
steps:
- name: ⚙️ Install System tools
run: |
apt update
apt install net-tools
- name: Setup IDF Examples path
run: |
mkdir idf_examples && cd idf_examples && pwd
echo "EXAMPLES_PATH=$(pwd)" >> $GITHUB_ENV
- name: ⚙️ Install Python packages
env:
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
run: pip install --only-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pyserial pyusb netifaces pytest_ignore_test_results
- uses: actions/download-artifact@v4
with:
name: usb_examples_bin_${{ matrix.idf_ver }}
path: ${{ env.EXAMPLES_PATH }}
- name: Run USB Test App on target
run: pytest ${{ env.EXAMPLES_PATH }}/${{ matrix.example }} --target ${{ matrix.idf_target }} -m ${{ matrix.runner_tag }} --ignore-result-cases=*ncm_example
Loading