forked from hathach/tinyusb
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(tinyusb): Added esp-usb test_apps build and run
- Loading branch information
Showing
1 changed file
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Build and Run USB Test Application | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' # Every day at midnight | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
build: | ||
name: Build USB TestApps | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "latest"] | ||
idf_ver: ["latest"] | ||
runs-on: ubuntu-20.04 | ||
container: espressif/idf:${{ matrix.idf_ver }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'true' | ||
- name: Clone esp-usb repository | ||
run: | | ||
git clone https://github.com/espressif/esp-usb.git | ||
- name: Build USB Test Application | ||
shell: bash | ||
run: | | ||
. ${IDF_PATH}/export.sh | ||
pip install idf-build-apps==2.4.3 --upgrade | ||
export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function" | ||
export EXTRA_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes" | ||
export EXTRA_CXXFLAGS="${PEDANTIC_FLAGS}" | ||
idf-build-apps find | ||
idf-build-apps build | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: usb_test_app_bin_${{ matrix.idf_ver }} | ||
path: | | ||
**/test_app*/**/build_esp*/bootloader/bootloader.bin | ||
**/test_app*/**/build_esp*/partition_table/partition-table.bin | ||
**/test_app*/**/build_esp*/test_app_*.bin | ||
**/test_app*/**/build_esp*/flasher_args.json | ||
**/test_app*/**/build_esp*/config/sdkconfig.json | ||
if-no-files-found: error | ||
|
||
run-target: | ||
name: Run USB Device TestApps on target | ||
if: ${{ github.repository_owner == 'espressif' }} | ||
needs: build | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "latest"] | ||
idf_target: ["esp32s2", "esp32p4"] | ||
runner_tag: ["usb_host", "usb_device"] | ||
exclude: | ||
# Exclude esp32p4 for releases before IDF 5.3 for all runner tags (esp32p4 support starts in IDF 5.3) | ||
- idf_ver: "release-v5.0" | ||
idf_target: "esp32p4" | ||
- idf_ver: "release-v5.1" | ||
idf_target: "esp32p4" | ||
- idf_ver: "release-v5.2" | ||
idf_target: "esp32p4" | ||
- idf_ver: "release-v5.3" # TODO: enable IDF 5.3 once the docker image is updated | ||
idf_target: "esp32p4" | ||
|
||
runs-on: [self-hosted, linux, docker, "${{ matrix.idf_target }}", "${{ matrix.runner_tag }}"] | ||
container: | ||
image: python:3.11-bookworm | ||
options: --privileged --device-cgroup-rule="c 188:* rmw" --device-cgroup-rule="c 166:* rmw" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Clone esp-usb repository | ||
run: | | ||
git clone https://github.com/espressif/esp-usb.git | ||
- name: Install Python packages | ||
env: | ||
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/" | ||
run: pip install --only-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pyserial pyusb | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: usb_test_app_bin_${{ matrix.idf_ver }} | ||
path: esp_usb | ||
- name: Run USB Test App on target | ||
run: pytest --embedded-services esp,idf --target=${{ matrix.idf_target }} -m ${{ matrix.runner_tag }} --build-dir=build_${{ matrix.idf_target }} |