Skip to content

Commit d00b6b7

Browse files
committed
ci(tinyusb): Added run pytest
1 parent 98aea07 commit d00b6b7

File tree

2 files changed

+73
-28
lines changed

2 files changed

+73
-28
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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.0", "release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "latest"]
12+
fail-fast: false
13+
runs-on: ubuntu-20.04
14+
container: espressif/idf:${{ matrix.idf_ver }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Build
18+
shell: bash
19+
run: |
20+
. ${IDF_PATH}/export.sh
21+
pip install idf-component-manager==1.5.2 idf-build-apps==2.4.3 --upgrade
22+
export EXAMPLES_PATH="${IDF_PATH}/examples/peripherals/usb/device"
23+
export MANIFEST_FILE="${IDF_PATH}/examples/peripherals/.build-test-rules.yml"
24+
python .github/ci/override_managed_component.py tinyusb . ${EXAMPLES_PATH}/tusb_*
25+
idf-build-apps find --path ${EXAMPLES_PATH}/ --recursive --target esp32s2 --manifest-file ${MANIFEST_FILE}
26+
idf-build-apps build --path ${EXAMPLES_PATH}/ --recursive --target esp32s2 --manifest-file ${MANIFEST_FILE}
27+
- uses: actions/upload-artifact@v4
28+
with:
29+
name: usb_device_tusb_apps_bin_${{ matrix.idf_ver }}
30+
path: |
31+
/opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/bootloader/bootloader.bin
32+
/opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/partition_table/partition-table.bin
33+
/opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/tusb_*.bin
34+
/opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/tusb_*.elf
35+
/opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/flasher_args.json
36+
/opt/esp/idf/examples/peripherals/usb/device/tusb_*/build/config/sdkconfig.json
37+
if-no-files-found: error
38+
run-target:
39+
name: Run
40+
if: ${{ github.repository_owner == 'espressif' }}
41+
needs: build
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
idf_ver: ["release-v5.3", "release-v5.4", "latest"]
46+
idf_target: ["esp32s2"]
47+
runner_tag: ["usb_device"]
48+
runs-on: [self-hosted, linux, docker, "${{ matrix.idf_target }}", "${{ matrix.runner_tag }}"]
49+
container:
50+
image: espressif/idf:${{ matrix.idf_ver }}
51+
options: --privileged --device-cgroup-rule="c 188:* rmw" --device-cgroup-rule="c 166:* rmw"
52+
steps:
53+
- name: ⚙️ Install System tools
54+
run: |
55+
apt update
56+
apt install net-tools
57+
- name: ⚙️ Install Python packages
58+
env:
59+
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
60+
run: |
61+
cd ${IDF_PATH}
62+
. ./export.sh
63+
pip install --only-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pyserial pyusb python-gitlab minio idf-build-apps pytest_ignore_test_results pytest-timeout netifaces
64+
- uses: actions/download-artifact@v4
65+
with:
66+
name: usb_device_tusb_apps_bin_${{ matrix.idf_ver }}
67+
path: /opt/esp/idf/examples/peripherals/usb/device
68+
- name: Run USB Test App on target
69+
run: |
70+
cd ${IDF_PATH}
71+
. ./export.sh
72+
export EXAMPLES_PATH="${IDF_PATH}/examples/peripherals/usb/device"
73+
pytest ${EXAMPLES_PATH} --target ${{ matrix.idf_target }} -m ${{ matrix.runner_tag }} --ignore-result-cases=*ncm_example

.github/workflows/build_idf_examples.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)