Skip to content

Commit b9d898c

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

File tree

2 files changed

+81
-28
lines changed

2 files changed

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

.github/workflows/build_idf_examples.yml

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

0 commit comments

Comments
 (0)