fix(ci): Cleanup and extension of workflows [v0.18] #161
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ESP-IDF USB Device examples | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize] | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| # idf_ver: ["release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "release-v5.5", "latest"] | |
| idf_ver: ["latest"] | |
| fail-fast: false | |
| runs-on: ubuntu-latest | |
| container: espressif/idf:${{ matrix.idf_ver }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Python dependencies | |
| shell: bash | |
| run: | | |
| . ${IDF_PATH}/export.sh | |
| pip install --no-cache-dir idf-component-manager>=2.1.2 idf-build-apps==2.4.3 pyyaml --upgrade | |
| - name: Build Network USB related examples | |
| shell: bash | |
| run: | | |
| . ${IDF_PATH}/export.sh | |
| export EXAMPLES_PATH="${IDF_PATH}/examples/network/sta2eth" | |
| export MANIFEST_FILE="${IDF_PATH}/examples/network/.build-test-rules.yml" | |
| python .github/ci/override_managed_component.py tinyusb . ${EXAMPLES_PATH} | |
| idf-build-apps find --path ${EXAMPLES_PATH}/ --target esp32s2 --manifest-file ${MANIFEST_FILE} | |
| idf-build-apps build --path ${EXAMPLES_PATH}/ --target esp32s2 --manifest-file ${MANIFEST_FILE} | |
| - name: Build USB Device examples | |
| shell: bash | |
| run: | | |
| . ${IDF_PATH}/export.sh | |
| export EXAMPLES_PATH="${IDF_PATH}/examples/peripherals/usb/device" | |
| export MANIFEST_FILE="${IDF_PATH}/examples/peripherals/.build-test-rules.yml" | |
| python .github/ci/override_managed_component.py tinyusb . ${EXAMPLES_PATH}/tusb_* | |
| idf-build-apps find --path ${EXAMPLES_PATH}/ --recursive --target esp32s2 --manifest-file ${MANIFEST_FILE} | |
| idf-build-apps build --path ${EXAMPLES_PATH}/ --recursive --target esp32s2 --manifest-file ${MANIFEST_FILE} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| # We upload only the USB Device example binaries to run them on the target | |
| name: usb_device_tusb_apps_bin_${{ matrix.idf_ver }} | |
| path: | | |
| /opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/bootloader/bootloader.bin | |
| /opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/partition_table/partition-table.bin | |
| /opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/tusb_*.bin | |
| /opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/tusb_*.elf | |
| /opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/flasher_args.json | |
| /opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/config/sdkconfig.json | |
| if-no-files-found: error | |
| run-target: | |
| name: Run USB Device examples | |
| if: ${{ github.repository_owner == 'espressif' }} | |
| needs: build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # idf_ver: ["release-v5.3", "release-v5.4", "release-v5.5" , "latest"] | |
| idf_ver: ["latest"] | |
| idf_target: ["esp32s2"] | |
| runner_tag: ["usb_device"] | |
| runs-on: [self-hosted, linux, docker, "${{ matrix.idf_target }}", "${{ matrix.runner_tag }}"] | |
| container: | |
| image: espressif/idf:${{ matrix.idf_ver }} | |
| options: --privileged --device-cgroup-rule="c 188:* rmw" --device-cgroup-rule="c 166:* rmw" | |
| steps: | |
| - name: ⚙️ Install System tools | |
| run: | | |
| apt update | |
| apt install net-tools | |
| - name: ⚙️ Install Python packages | |
| env: | |
| PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/" | |
| run: | | |
| cd ${IDF_PATH} | |
| . ./export.sh | |
| 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 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: usb_device_tusb_apps_bin_${{ matrix.idf_ver }} | |
| path: /opt/esp/idf/examples/peripherals/usb/device | |
| - name: Run USB Test App on target | |
| run: | | |
| cd ${IDF_PATH} | |
| . ./export.sh | |
| export EXAMPLES_PATH="${IDF_PATH}/examples/peripherals/usb/device" | |
| pytest ${EXAMPLES_PATH} --target ${{ matrix.idf_target }} -m ${{ matrix.runner_tag }} --ignore-result-cases=*ncm_example |