|
1 | | -# This workflow builds esp-idf examples: |
| 1 | +# This workflow builds and runs esp-idf examples: |
2 | 2 | # |
| 3 | +# Build: |
3 | 4 | # - usb device examples: with overridden esp_tinyusb from esp-usb/device/esp_tinyusb |
4 | | -# - Override esp_tinyusb component only for IDF >= 6.0 temporarily |
| 5 | +# - Override esp_tinyusb component only for IDF 5.3, IDF 5.5, IDF 6.0 and latest temporarily, others have not been backported |
5 | 6 | # |
6 | 7 | # - usb host examples: |
7 | 8 | # - Overridden usb component from esp-usb/host/usb and overridden class drivers from esp-usb/host/class |
|
11 | 12 | # |
12 | 13 | # - cherryusb examples are ignored |
13 | 14 | # - usb_host_lib example -> manifest file must be created for IDF < 6.0 to override usb component |
| 15 | +# |
| 16 | +# Run: |
| 17 | +# - usb device examples: Run on usb_device targets, with matrix of all listed releases |
| 18 | +# - usb host examples: Run on usb_host_examples, with matrix of all listed releases, except IDF Latest |
| 19 | +# |
| 20 | +# |
| 21 | +# Temporarily disabled tests and TODOs of this workflow: |
| 22 | +# - USB Device examples build: Only for only for IDF 5.3, IDF 5.5, IDF 6.0 and latest temporarily, others have not been backported |
| 23 | +# - USB Host examples run: IDF latest disabled (ECO4-ECO5 build-runner mismatch) |
14 | 24 |
|
15 | 25 | name: Build ESP-IDF USB examples |
16 | 26 |
|
|
20 | 30 |
|
21 | 31 | jobs: |
22 | 32 | build: |
| 33 | + # Condition: |
| 34 | + # 1. PR title contains "release" (case-sensitive) |
| 35 | + # 2. PR labels include "run full tests" |
| 36 | + if: | |
| 37 | + contains(github.event.pull_request.title, 'release') || |
| 38 | + contains(github.event.pull_request.labels.*.name, 'tests esp-idf') |
23 | 39 | strategy: |
24 | 40 | fail-fast: true |
25 | 41 | matrix: |
|
51 | 67 | - name: Setup IDF Examples path |
52 | 68 | run: echo "EXAMPLES_PATH=${IDF_PATH}/examples/peripherals/usb" >> $GITHUB_ENV |
53 | 69 | - name: Override device component |
54 | | - # Override esp_tinyusb component only for IDF >= 6.0 temporarily |
55 | | - if: contains('release-v6.0 latest', matrix.idf_ver) |
| 70 | + # Override esp_tinyusb component only for IDF 5.3, IDF 5.5, IDF 6.0 and latest temporarily, others have not been backported |
| 71 | + if: contains('release-v5.3 release-v5.5 release-v6.0 latest', matrix.idf_ver) |
56 | 72 | run: | |
57 | 73 | . ${IDF_PATH}/export.sh |
58 | 74 | python .github/ci/override_managed_component.py esp_tinyusb device/esp_tinyusb ${{ env.EXAMPLES_PATH }}/device/* |
@@ -126,3 +142,75 @@ jobs: |
126 | 142 |
|
127 | 143 | idf-build-apps find --config-file ${CONFIG_PATH} --manifest-file ${MANIFEST_PATH} |
128 | 144 | idf-build-apps build --config-file ${CONFIG_PATH} --manifest-file ${MANIFEST_PATH} |
| 145 | +
|
| 146 | + - uses: actions/upload-artifact@v4 |
| 147 | + with: |
| 148 | + name: usb_examples_bin_${{ matrix.idf_ver }} |
| 149 | + path: | |
| 150 | + ${{ env.EXAMPLES_PATH }}/**/build_esp*/bootloader/bootloader.bin |
| 151 | + ${{ env.EXAMPLES_PATH }}/**/build_esp*/partition_table/partition-table.bin |
| 152 | + ${{ env.EXAMPLES_PATH }}/**/build_esp*/*.bin |
| 153 | + ${{ env.EXAMPLES_PATH }}/**/build_esp*/*.elf |
| 154 | + ${{ env.EXAMPLES_PATH }}/**/build_esp*/flasher_args.json |
| 155 | + ${{ env.EXAMPLES_PATH }}/**/build_esp*/config/sdkconfig.json |
| 156 | + if-no-files-found: error |
| 157 | + |
| 158 | + run-target: |
| 159 | + name: Run esp-idf examples |
| 160 | + if: ${{ github.repository_owner == 'espressif' }} |
| 161 | + needs: build |
| 162 | + strategy: |
| 163 | + fail-fast: false |
| 164 | + matrix: |
| 165 | + idf_ver: |
| 166 | + [ |
| 167 | + "release-v5.1", |
| 168 | + "release-v5.2", |
| 169 | + "release-v5.3", |
| 170 | + "release-v5.4", |
| 171 | + "release-v5.5", |
| 172 | + "release-v6.0", |
| 173 | + "latest", |
| 174 | + ] |
| 175 | + idf_target: ["esp32s2", "esp32p4"] |
| 176 | + runner_tag: ["usb_host_flash_disk", "usb_device"] |
| 177 | + include: |
| 178 | + - runner_tag: usb_host_flash_disk |
| 179 | + example: host |
| 180 | + - runner_tag: usb_device |
| 181 | + example: device |
| 182 | + exclude: |
| 183 | + # Temp exclude esp32p4 usb_host_flash_disk run for IDF Latest (ECO4-ECO5 build-runner mismatch) |
| 184 | + - runner_tag: usb_host_flash_disk |
| 185 | + idf_ver: "latest" |
| 186 | + - runner_tag: usb_device |
| 187 | + idf_ver: "latest" |
| 188 | + runs-on: [self-hosted, linux, docker, "${{ matrix.idf_target }}", "${{ matrix.runner_tag }}"] |
| 189 | + container: |
| 190 | + image: espressif/idf:${{ matrix.idf_ver }} |
| 191 | + options: --privileged --device-cgroup-rule="c 188:* rmw" --device-cgroup-rule="c 166:* rmw" |
| 192 | + env: |
| 193 | + EXAMPLES_PATH: ${{ github.workspace }} |
| 194 | + steps: |
| 195 | + - name: ⚙️ Install System tools |
| 196 | + run: | |
| 197 | + apt update |
| 198 | + apt install net-tools |
| 199 | + - name: Setup IDF Examples path |
| 200 | + run: echo "EXAMPLES_PATH=${IDF_PATH}/examples/peripherals/usb" >> $GITHUB_ENV |
| 201 | + - name: ⚙️ Install Python packages |
| 202 | + env: |
| 203 | + PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/" |
| 204 | + run: | |
| 205 | + cd ${IDF_PATH} |
| 206 | + . ./export.sh |
| 207 | + pip install --no-cache-dir --only-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pyserial pyusb netifaces idf-ci |
| 208 | + - uses: actions/download-artifact@v4 |
| 209 | + with: |
| 210 | + name: usb_examples_bin_${{ matrix.idf_ver }} |
| 211 | + path: ${{ env.EXAMPLES_PATH }} |
| 212 | + - name: Run USB Test App on target |
| 213 | + run: | |
| 214 | + cd ${IDF_PATH} |
| 215 | + . ./export.sh |
| 216 | + pytest ${{ env.EXAMPLES_PATH }}/${{ matrix.example }} --target ${{ matrix.idf_target }} -m ${{ matrix.runner_tag }} |
0 commit comments