Skip to content

Commit 0e3ca04

Browse files
feat(ci): Build idf examples with all overridden components
- all component used in usb device and host examples are overridden - esp_tinyusb, usb and all class drivers - using ignore_build_warnings.txt from esp-idf to match the idf CI environment
1 parent 2863968 commit 0e3ca04

File tree

3 files changed

+48
-9
lines changed

3 files changed

+48
-9
lines changed

.github/ci/.idf-build-examples-rules.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ examples/peripherals/usb/device/tusb_ncm:
1515
- if: SOC_USB_OTG_SUPPORTED != 1 or SOC_WIFI_SUPPORTED != 1
1616

1717
examples/peripherals/usb/host:
18-
enable:
19-
- if: (IDF_VERSION >= "5.4.0")
20-
reason: Run USB Host examples with overridden (esp-usb) USB component only for service releases
2118
disable:
2219
- if: SOC_USB_OTG_SUPPORTED != 1
2320

.github/ci/.idf_build_examples_config.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ target = "all"
1111

1212
# build related options
1313
build_dir = "build_@t_@w"
14-
work_dir = "@f_@t_@w"
14+
15+
# use ignore_build_warnings.txt from esp-idf
16+
ignore_warning_files = [
17+
'tools/ci/ignore_build_warnings.txt',
18+
]
1519

1620
# config rules
1721
config_rules = [

.github/workflows/build_idf_examples.yml

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
# - usb device examples: with overridden esp_tinyusb from esp-usb/device/esp_tinyusb
44
# - Only IDF Latest
55
#
6-
# - usb host examples: with overridden usb component from esp-usb/host/usb
7-
# - Only service IDF releases
6+
# - usb host examples:
7+
# - Overridden usb component from esp-usb/host/usb and overridden class drivers from esp-usb/host/class
8+
# - Only service IDF releases
9+
# - Overridden class drivers from esp-usb/host/class
10+
# - All (service + maintenance IDF releases)
811

912
name: Build ESP-IDF USB examples
1013

@@ -31,6 +34,7 @@ jobs:
3134
env:
3235
CONFIG_PATH: ${{ github.workspace }}/.github/ci/.idf_build_examples_config.toml
3336
MANIFEST_PATH: ${{ github.workspace }}/.github/ci/.idf-build-examples-rules.yml
37+
EXAMPLES_PATH: ${{ github.workspace }}
3438
steps:
3539
- uses: actions/checkout@v4
3640
with:
@@ -40,14 +44,48 @@ jobs:
4044
run: |
4145
. ${IDF_PATH}/export.sh
4246
pip install idf-component-manager>=2.1.2 idf-build-apps==2.12.2 pyyaml --upgrade
47+
- name: Setup IDF Examples path
48+
run: echo "EXAMPLES_PATH=${IDF_PATH}/examples/peripherals/usb" >> $GITHUB_ENV
49+
- name: Override device component
50+
if: contains('latest', matrix.idf_ver)
51+
run: |
52+
. ${IDF_PATH}/export.sh
53+
python .github/ci/override_managed_component.py esp_tinyusb device/esp_tinyusb ${{ env.EXAMPLES_PATH }}/device/*
54+
- name: Override class components
55+
run: |
56+
. ${IDF_PATH}/export.sh
57+
58+
# cdc
59+
python .github/ci/override_managed_component.py usb_host_cdc_acm host/class/cdc/usb_host_cdc_acm ${{ env.EXAMPLES_PATH }}/host/cdc/*
60+
61+
# hid
62+
python .github/ci/override_managed_component.py usb_host_hid host/class/cdc/usb_host_hid ${{ env.EXAMPLES_PATH }}/host/hid/*
63+
64+
# msc
65+
python .github/ci/override_managed_component.py usb_host_msc host/class/cdc/usb_host_msc ${{ env.EXAMPLES_PATH }}/host/msc/*
66+
67+
# uac
68+
python .github/ci/override_managed_component.py usb_host_uac host/class/cdc/usb_host_uac ${{ env.EXAMPLES_PATH }}/host/uac/*
69+
70+
# uvc
71+
python .github/ci/override_managed_component.py usb_host_uvc host/class/cdc/usb_host_uvc ${{ env.EXAMPLES_PATH }}/host/uvc/*
72+
73+
- name: Override usb component
74+
if: contains('release-v5.4 release-v5.5 latest', matrix.idf_ver)
75+
run: |
76+
# Override usb component only for maintenance releases
77+
. ${IDF_PATH}/export.sh
78+
python .github/ci/override_managed_component.py usb host/usb ${{ env.EXAMPLES_PATH }}/host/*
4379
- name: Build ESP-IDF ${{ matrix.idf_ver }} USB examples
4480
shell: bash
4581
run: |
4682
. ${IDF_PATH}/export.sh
47-
48-
python .github/ci/override_managed_component.py esp_tinyusb device/esp_tinyusb ${IDF_PATH}/examples/peripherals/usb/device/*
49-
python .github/ci/override_managed_component.py usb host/usb ${IDF_PATH}/examples/peripherals/usb/host/*
5083
cd ${IDF_PATH}
5184
85+
# Export compiler flags
86+
export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
87+
export EXTRA_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes"
88+
export EXTRA_CXXFLAGS="${PEDANTIC_FLAGS}"
89+
5290
idf-build-apps find --config-file ${CONFIG_PATH} --manifest-file ${MANIFEST_PATH}
5391
idf-build-apps build --config-file ${CONFIG_PATH} --manifest-file ${MANIFEST_PATH}

0 commit comments

Comments
 (0)