Skip to content

Commit be30b80

Browse files
committed
ci(tinyusb): Added esp-usb test_apps build and run
1 parent 58b8f1f commit be30b80

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Build and Run USB Test Application
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # Every day at midnight
6+
pull_request:
7+
types: [opened, reopened, synchronize]
8+
9+
jobs:
10+
build:
11+
name: Build USB TestApps
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "latest"]
16+
runs-on: ubuntu-20.04
17+
container: espressif/idf:${{ matrix.idf_ver }}
18+
env:
19+
ESP_USB_MANIFEST: ./esp-usb/.build-test-rules.yml
20+
ESP_TINYUSB_TEST_APPS: ./esp-usb/device/esp_tinyusb/test_apps
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
submodules: 'true'
25+
- name: Clone esp-usb repository
26+
run: |
27+
git clone https://github.com/espressif/esp-usb.git
28+
- name: Build USB Test Application
29+
shell: bash
30+
run: |
31+
. ${IDF_PATH}/export.sh
32+
pip install idf-component-manager==1.5.2 idf-build-apps==2.4.3 --upgrade
33+
export PEDANTIC_FLAGS="-DIDF_CI_BUILD -Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
34+
export EXTRA_CFLAGS="${PEDANTIC_FLAGS} -Wstrict-prototypes"
35+
export EXTRA_CXXFLAGS="${PEDANTIC_FLAGS}"
36+
python .github/ci/override_managed_component.py tinyusb . ${{ env.ESP_TINYUSB_TEST_APPS }}/*/
37+
idf-build-apps find --path ${{ env.ESP_TINYUSB_TEST_APPS }}/ --recursive --target esp32s2 --manifest-file ${{ env.ESP_USB_MANIFEST }}
38+
idf-build-apps build --path ${{ env.ESP_TINYUSB_TEST_APPS }}/ --recursive --target esp32s2 --manifest-file ${{ env.ESP_USB_MANIFEST }}
39+
- uses: actions/upload-artifact@v4
40+
with:
41+
name: usb_test_app_bin_${{ matrix.idf_ver }}
42+
path: |
43+
${{env.ESP_TINYUSB_TEST_APPS}}/**/build/bootloader/bootloader.bin
44+
${{env.ESP_TINYUSB_TEST_APPS}}/**/build/partition_table/partition-table.bin
45+
${{env.ESP_TINYUSB_TEST_APPS}}/**/build/test_app_*.bin
46+
${{env.ESP_TINYUSB_TEST_APPS}}/**/build/flasher_args.json
47+
${{env.ESP_TINYUSB_TEST_APPS}}/**/build/config/sdkconfig.json
48+
if-no-files-found: error
49+
50+
run-target:
51+
name: Run USB Device TestApps on target
52+
if: ${{ github.repository_owner == 'espressif' }}
53+
needs: build
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "latest"]
58+
idf_target: ["esp32s2"]
59+
runner_tag: ["usb_device"]
60+
runs-on: [self-hosted, linux, docker, "${{ matrix.idf_target }}", "${{ matrix.runner_tag }}"]
61+
container:
62+
image: python:3.11-bookworm
63+
options: --privileged --device-cgroup-rule="c 188:* rmw" --device-cgroup-rule="c 166:* rmw"
64+
env:
65+
ESP_TINYUSB_TEST_APPS: ./esp-usb/device/esp_tinyusb/test_apps
66+
steps:
67+
- uses: actions/checkout@v4
68+
- name: Clone esp-usb repository
69+
run: |
70+
git clone https://github.com/espressif/esp-usb.git
71+
- name: Install Python packages
72+
env:
73+
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
74+
run: pip install --only-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pyserial pyusb
75+
- uses: actions/download-artifact@v4
76+
with:
77+
name: usb_test_app_bin_${{ matrix.idf_ver }}
78+
path: ${{env.ESP_TINYUSB_TEST_APPS}}
79+
- name: Run USB Test App on target
80+
run: pytest ${{env.ESP_TINYUSB_TEST_APPS}} --embedded-services esp,idf --target=${{ matrix.idf_target }} -m ${{ matrix.runner_tag }}

0 commit comments

Comments
 (0)