Skip to content

Commit b339c84

Browse files
authored
Merge pull request #42 from espressif/ci/add_build_and_run_esp_usb_test_apps
ci(tinyusb): Added esp-usb test_apps build and run (esp32s2)
2 parents 135618b + 5ca0293 commit b339c84

File tree

2 files changed

+81
-2
lines changed

2 files changed

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

.github/workflows/build_idf_examples.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build ESP-IDF USB examples
1+
name: ESP-IDF USB Device examples
22

33
on:
44
schedule:
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v4
1818
with:
1919
submodules: 'true'
20-
- name: Build ESP-IDF USB Device examples
20+
- name: Build
2121
shell: bash
2222
run: |
2323
. ${IDF_PATH}/export.sh

0 commit comments

Comments
 (0)