|
| 1 | +name: ESP-IDF USB Device examples |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [opened, reopened, synchronize] |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + idf_ver: ["release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "release-v5.5", "latest"] |
| 12 | + fail-fast: false |
| 13 | + runs-on: ubuntu-latest |
| 14 | + container: espressif/idf:${{ matrix.idf_ver }} |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v4 |
| 17 | + - name: Install Python dependencies |
| 18 | + shell: bash |
| 19 | + run: | |
| 20 | + . ${IDF_PATH}/export.sh |
| 21 | + pip install --no-cache-dir idf-component-manager>=2.1.2 idf-build-apps==2.4.3 pyyaml --upgrade |
| 22 | + - name: Build Network USB related examples |
| 23 | + shell: bash |
| 24 | + run: | |
| 25 | + . ${IDF_PATH}/export.sh |
| 26 | + export EXAMPLES_PATH="${IDF_PATH}/examples/network/sta2eth" |
| 27 | + 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} |
| 30 | + - name: Build USB Device examples |
| 31 | + shell: bash |
| 32 | + run: | |
| 33 | + . ${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} |
| 39 | + - uses: actions/upload-artifact@v4 |
| 40 | + 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 }} |
| 43 | + 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 | + if-no-files-found: error |
| 51 | + run-target: |
| 52 | + name: Run USB Device examples |
| 53 | + if: ${{ github.repository_owner == 'espressif' }} |
| 54 | + needs: build |
| 55 | + strategy: |
| 56 | + fail-fast: false |
| 57 | + matrix: |
| 58 | + idf_ver: ["release-v5.3", "release-v5.4", "release-v5.5" , "latest"] |
| 59 | + idf_target: ["esp32s2"] |
| 60 | + runner_tag: ["usb_device"] |
| 61 | + runs-on: [self-hosted, linux, docker, "${{ matrix.idf_target }}", "${{ matrix.runner_tag }}"] |
| 62 | + container: |
| 63 | + image: espressif/idf:${{ matrix.idf_ver }} |
| 64 | + options: --privileged --device-cgroup-rule="c 188:* rmw" --device-cgroup-rule="c 166:* rmw" |
| 65 | + steps: |
| 66 | + - name: ⚙️ Install System tools |
| 67 | + run: | |
| 68 | + apt update |
| 69 | + apt install net-tools |
| 70 | + - name: ⚙️ Install Python packages |
| 71 | + env: |
| 72 | + PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/" |
| 73 | + run: | |
| 74 | + cd ${IDF_PATH} |
| 75 | + . ./export.sh |
| 76 | + 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 |
| 77 | + - uses: actions/download-artifact@v4 |
| 78 | + 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 |
| 82 | + 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 |
0 commit comments