Skip to content

Commit 45aafa6

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

File tree

2 files changed

+79
-28
lines changed

2 files changed

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