Skip to content

Commit 8e5c1eb

Browse files
feat(ci): Run esp-idf examples on targets
1 parent f697348 commit 8e5c1eb

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/build_idf_examples.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,69 @@ jobs:
126126
127127
idf-build-apps find --config-file ${CONFIG_PATH} --manifest-file ${MANIFEST_PATH}
128128
idf-build-apps build --config-file ${CONFIG_PATH} --manifest-file ${MANIFEST_PATH}
129+
130+
- uses: actions/upload-artifact@v4
131+
with:
132+
name: usb_examples_bin_${{ matrix.idf_ver }}
133+
path: |
134+
${{ env.EXAMPLES_PATH }}/**/build_esp*/bootloader/bootloader.bin
135+
${{ env.EXAMPLES_PATH }}/**/build_esp*/partition_table/partition-table.bin
136+
${{ env.EXAMPLES_PATH }}/**/build_esp*/*.bin
137+
${{ env.EXAMPLES_PATH }}/**/build_esp*/*.elf
138+
${{ env.EXAMPLES_PATH }}/**/build_esp*/flasher_args.json
139+
${{ env.EXAMPLES_PATH }}/**/build_esp*/config/sdkconfig.json
140+
if-no-files-found: error
141+
142+
run-target:
143+
name: Run esp-idf examples
144+
if: ${{ github.repository_owner == 'espressif' }}
145+
needs: build
146+
strategy:
147+
fail-fast: false
148+
matrix:
149+
idf_ver:
150+
[
151+
"release-v5.1",
152+
"release-v5.2",
153+
"release-v5.3",
154+
"release-v5.4",
155+
"release-v5.5",
156+
"release-v6.0",
157+
"latest",
158+
]
159+
idf_target: ["esp32s2", "esp32p4"]
160+
runner_tag: ["usb_host_flash_disk"]
161+
include:
162+
- runner_tag: usb_host_flash_disk
163+
example: host
164+
#- runner_tag: usb_device
165+
# example: device
166+
runs-on: [self-hosted, linux, docker, "${{ matrix.idf_target }}", "${{ matrix.runner_tag }}"]
167+
container:
168+
image: espressif/idf:${{ matrix.idf_ver }}
169+
options: --privileged --device-cgroup-rule="c 188:* rmw" --device-cgroup-rule="c 166:* rmw"
170+
env:
171+
EXAMPLES_PATH: ${{ github.workspace }}
172+
steps:
173+
- name: ⚙️ Install System tools
174+
run: |
175+
apt update
176+
apt install net-tools
177+
- name: Setup IDF Examples path
178+
run: echo "EXAMPLES_PATH=${IDF_PATH}/examples/peripherals/usb" >> $GITHUB_ENV
179+
- name: ⚙️ Install Python packages
180+
env:
181+
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
182+
run: |
183+
cd ${IDF_PATH}
184+
. ./export.sh
185+
pip install --no-cache-dir --only-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-jtag pytest-embedded-idf pyserial pyusb python-gitlab minio idf-build-apps pytest_ignore_test_results pytest-timeout netifaces
186+
- uses: actions/download-artifact@v4
187+
with:
188+
name: usb_examples_bin_${{ matrix.idf_ver }}
189+
path: ${{ env.EXAMPLES_PATH }}
190+
- name: Run USB Test App on target
191+
run: |
192+
cd ${IDF_PATH}
193+
. ./export.sh
194+
pytest ${{ env.EXAMPLES_PATH }}/${{ matrix.example }} --target ${{ matrix.idf_target }} -m ${{ matrix.runner_tag }}

0 commit comments

Comments
 (0)