|
| 1 | +# This workflow builds and runs ESP-USB Host test applications for pull requests. |
| 2 | +# It checks out the latest code from ESP-USB master, builds the USB Host Library and Classes test applications using Espressif's IDF, |
| 3 | +# uploads artifacts, and runs tests on self-hosted runners for supported targets. |
| 4 | + |
| 5 | +name: ESP-USB Host Test Apps |
| 6 | + |
| 7 | +on: |
| 8 | + pull_request: |
| 9 | + types: [opened, reopened, synchronize] |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + name: Build |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + # TODO: increase the coverage, for now - latest only |
| 18 | + idf_ver: ["latest"] |
| 19 | + runs-on: ubuntu-latest |
| 20 | + container: espressif/idf:${{ matrix.idf_ver }} |
| 21 | + env: |
| 22 | + IDF_COMP_MAN_VER: "2.4.3" |
| 23 | + IDF_BUILD_APPS_VER: "2.13.3" |
| 24 | + # We are cloning esp-usb repo to get the test apps to build, the paths should be configured explicitly |
| 25 | + ESP_USB_PATH: esp-usb |
| 26 | + ESP_USB_CONFIG_FILE: esp-usb/.idf_build_apps.toml |
| 27 | + ESP_USB_MANIFEST: esp-usb/.build-test-rules.yml |
| 28 | + ESP_USB_IGNORE_WARNING_FILE: esp-usb/.ignore_build_warnings.txt |
| 29 | + ESP_HOST_TEST_APPS: esp-usb/host |
| 30 | + steps: |
| 31 | + - uses: actions/checkout@v4 |
| 32 | + with: |
| 33 | + submodules: 'true' |
| 34 | + - name: Clone esp-usb repository |
| 35 | + run: | |
| 36 | + git clone https://github.com/espressif/esp-usb.git |
| 37 | + - name: Build |
| 38 | + shell: bash |
| 39 | + run: | |
| 40 | + . ${IDF_PATH}/export.sh |
| 41 | + pip install --no-cache-dir idf-component-manager>=${{ env.IDF_COMP_MAN_VER }} idf-build-apps==${{ env.IDF_BUILD_APPS_VER }} pyyaml --upgrade |
| 42 | + export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function" |
| 43 | + export EXTRA_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes" |
| 44 | + export EXTRA_CXXFLAGS="${PEDANTIC_FLAGS}" |
| 45 | + export ENV_VAR_USB_COMP_MANAGED=yes |
| 46 | +
|
| 47 | + python .github/ci/override_managed_component.py tinyusb . ${{ env.ESP_HOST_TEST_APPS }}/*/ |
| 48 | + idf-build-apps find --config-file ${{ env.ESP_USB_CONFIG_FILE }} -p ${{ env.ESP_HOST_TEST_APPS }} -t all --manifest-files ${{ env.ESP_USB_MANIFEST }} --manifest-rootpath ${{ env.ESP_USB_PATH }} |
| 49 | + idf-build-apps build --config-file ${{ env.ESP_USB_CONFIG_FILE }} -p ${{ env.ESP_HOST_TEST_APPS }} -t all --manifest-files ${{ env.ESP_USB_MANIFEST }} --manifest-rootpath ${{ env.ESP_USB_PATH }} --ignore-warning-files ${{ env.ESP_USB_IGNORE_WARNING_FILE }} |
| 50 | + - uses: actions/upload-artifact@v4 |
| 51 | + with: |
| 52 | + # Test apps builds live under the repository workspace, we use workspace-relative glob |
| 53 | + name: usb_host_test_app_bin_${{ matrix.idf_ver }} |
| 54 | + path: | |
| 55 | + **/build_esp*/bootloader/bootloader.bin |
| 56 | + **/build_esp*/partition_table/partition-table.bin |
| 57 | + **/build_esp*/test_app_*.bin |
| 58 | + **/build_esp*/test_app_*.elf |
| 59 | + **/build_esp*/flasher_args.json |
| 60 | + **/build_esp*/config/sdkconfig.json |
| 61 | + if-no-files-found: error |
0 commit comments