-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(runner): Flash and run builded examples to BSP Wall Runner
- Loading branch information
Showing
12 changed files
with
322 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,186 @@ | ||
name: Build ESP-BSP apps | ||
|
||
# This job builds all examples and test_applications in this repo | ||
# Applications are selected for build based on changes files and dependecies defined in .build-test-rules.yml | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened, synchronize] | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
include: | ||
- idf_ver: "latest" | ||
parallel_count: 5 | ||
parallel_index: 1 | ||
- idf_ver: "latest" | ||
parallel_count: 5 | ||
parallel_index: 2 | ||
- idf_ver: "latest" | ||
parallel_count: 5 | ||
parallel_index: 3 | ||
- idf_ver: "latest" | ||
parallel_count: 5 | ||
parallel_index: 4 | ||
- idf_ver: "latest" | ||
parallel_count: 5 | ||
parallel_index: 5 | ||
- idf_ver: "release-v5.1" | ||
parallel_count: 2 | ||
parallel_index: 1 | ||
- idf_ver: "release-v5.1" | ||
parallel_count: 2 | ||
parallel_index: 2 | ||
- idf_ver: "release-v5.2" | ||
parallel_count: 2 | ||
parallel_index: 1 | ||
- idf_ver: "release-v5.2" | ||
parallel_count: 2 | ||
parallel_index: 2 | ||
- idf_ver: "release-v5.3" | ||
parallel_count: 2 | ||
parallel_index: 1 | ||
- idf_ver: "release-v5.3" | ||
parallel_count: 2 | ||
parallel_index: 2 | ||
- idf_ver: "release-v5.4" | ||
parallel_count: 2 | ||
parallel_index: 1 | ||
- idf_ver: "release-v5.4" | ||
parallel_count: 2 | ||
parallel_index: 2 | ||
runs-on: ubuntu-latest | ||
container: espressif/idf:${{ matrix.idf_ver }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v45 | ||
|
||
- name: Build ESP-BSP applications | ||
shell: bash | ||
env: | ||
IDF_EXTRA_ACTIONS_PATH: "${{ github.workspace }}/examples" | ||
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
run: | | ||
. ${IDF_PATH}/export.sh | ||
pip install idf-component-manager==1.* ruamel.yaml idf-build-apps==2.4.3 --upgrade | ||
echo "Files changed: ${ALL_CHANGED_FILES}" | ||
idf-build-apps find --modified-files "${ALL_CHANGED_FILES}" | ||
idf-build-apps build --parallel-count ${{ matrix.parallel_count }} --parallel-index ${{ matrix.parallel_index }} --modified-files "${ALL_CHANGED_FILES}" --collect-app-info build_info_${{ matrix.idf_ver }}_${{ matrix.parallel_index }}.json | ||
- uses: actions/upload-artifact@v4 | ||
if: github.repository_owner == 'espressif' && needs.prepare.outputs.build_only == '0' | ||
with: | ||
name: app_binaries_${{ matrix.idf_ver }}_${{ matrix.parallel_index }} | ||
path: | | ||
examples/*/build_*/bootloader/bootloader.bin | ||
examples/*/build_*/partition_table/partition-table.bin | ||
examples/*/build_*/*.bin | ||
examples/*/build_*/flasher_args.json | ||
examples/*/build_*/config/sdkconfig.json | ||
build_info*.json | ||
run-target: | ||
name: Run apps | ||
if: github.repository_owner == 'espressif' && needs.prepare.outputs.build_only != '1' | ||
needs: build | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 5 | ||
matrix: | ||
idf_ver: | ||
- "latest" | ||
runner: | ||
- runs-on: "esp-box-3" | ||
marker: "esp_box_3" | ||
target: "esp32s3" | ||
- runs-on: "esp32_c3_lcdkit" | ||
marker: "esp32_c3_lcdkit" | ||
target: "esp32c3" | ||
- runs-on: "esp32_p4_box" | ||
marker: "esp32_p4_box" | ||
target: "esp32p4" | ||
- runs-on: "esp32_p4_function_ev_board" | ||
marker: "esp32_p4_function_ev_board" | ||
target: "esp32p4" | ||
- runs-on: "esp32_s3_eye" | ||
marker: "esp32_s3_eye" | ||
target: "esp32s3" | ||
- runs-on: "esp32_s3_lcd_ev_board" | ||
marker: "esp32_s3_lcd_ev_board" | ||
target: "esp32s3" | ||
- runs-on: "esp32_s3_lcd_ev_board" | ||
marker: "esp32_s3_lcd_ev_board_2" | ||
target: "esp32s3" | ||
- runs-on: "esp32_s3_usb_otg" | ||
marker: "esp32_s3_usb_otg" | ||
target: "esp32s3" | ||
- runs-on: "esp_wrover_kit" | ||
marker: "esp_wrover_kit" | ||
target: "esp32" | ||
- runs-on: "m5dial" | ||
marker: "m5dial" | ||
target: "esp32s3" | ||
- runs-on: "m5stack_core" | ||
marker: "m5stack_core" | ||
target: "esp32" | ||
- runs-on: "m5stack_core_2" | ||
marker: "m5stack_core_2" | ||
target: "esp32" | ||
- runs-on: "m5stack_core_s3" | ||
marker: "m5stack_core_s3" | ||
target: "esp32s3" | ||
- runs-on: "m5stack_core_s3" | ||
marker: "m5stack_core_s3_se" | ||
target: "esp32s3" | ||
- runs-on: "esp32_azure_iot_kit" | ||
marker: "esp32_azure_iot_kit" | ||
target: "esp32" | ||
env: | ||
TEST_RESULT_NAME: test_results_${{ matrix.runner.target }}_${{ matrix.runner.marker }}_${{ matrix.idf_ver }} | ||
TEST_RESULT_FILE: test_results_${{ matrix.runner.target }}_${{ matrix.runner.marker }}_${{ matrix.idf_ver }}.xml | ||
runs-on: [self-hosted, Linux, bspwall] | ||
container: | ||
image: python:3.11-bookworm | ||
options: --privileged -v /dev/boards:/dev/boards/ # Privileged mode has access to serial ports | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: app_binaries_${{ matrix.idf_ver }}_* | ||
merge-multiple: true | ||
- name: Install Python packages | ||
env: | ||
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/" | ||
run: pip install --prefer-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pytest-custom_exit_code | ||
- name: Run apps | ||
run: | | ||
pytest --suppress-no-test-exit-code --ignore-glob '*/managed_components/*' --ignore=.github --junit-xml=${{ env.TEST_RESULT_FILE }} --target=${{ matrix.runner.target }} -m ${{ matrix.runner.marker }} --build-dir=build_${{ matrix.runner.runs-on }} | ||
- name: Upload test results | ||
uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: ${{ env.TEST_RESULT_NAME }} | ||
path: ${{ env.TEST_RESULT_FILE }} | ||
|
||
publish-results: | ||
name: Publish Test results | ||
needs: | ||
- run-target | ||
if: github.repository_owner == 'espressif' && always() && github.event_name == 'pull_request' && needs.prepare.outputs.build_only == '0' | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Download Test results | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: test_results_* | ||
path: test_results | ||
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
with: | ||
files: test_results/**/*.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
# SPDX-License-Identifier: Apache-2.0 | ||
import pytest | ||
|
||
|
||
def pytest_generate_tests(metafunc): | ||
# If test expects param 'port' or 'flash_port', add parametrize | ||
if 'port' in metafunc.fixturenames and 'flash_port' in metafunc.fixturenames: | ||
metafunc.parametrize( | ||
'port, flash_port', | ||
[ | ||
pytest.param('/dev/boards/esp-box-3', '/dev/boards/esp-box-3', id='esp_box_3'), | ||
pytest.param('/dev/boards/esp32_c3_lcdkit', '/dev/boards/esp32_c3_lcdkit', id='esp32_c3_lcdkit'), | ||
pytest.param('/dev/boards/esp32_p4_box', '/dev/boards/esp32_p4_box', id='esp32_p4_box'), | ||
pytest.param('/dev/boards/esp32_p4_function_ev_board', '/dev/boards/esp32_p4_function_ev_board', id='esp32_p4_function_ev_board'), | ||
pytest.param('/dev/boards/esp32_s3_eye', '/dev/boards/esp32_s3_eye', id='esp32_s3_eye'), | ||
pytest.param('/dev/boards/esp32_s3_lcd_ev_board', '/dev/boards/esp32_s3_lcd_ev_board', id='esp32_s3_lcd_ev_board'), | ||
pytest.param('/dev/boards/esp32_s3_lcd_ev_board-2', '/dev/boards/esp32_s3_lcd_ev_board-2', id='esp32_s3_lcd_ev_board_2'), | ||
pytest.param('/dev/boards/esp32_s3_usb_otg', '/dev/boards/esp32_s3_usb_otg', id='esp32_s3_usb_otg'), | ||
pytest.param('/dev/boards/esp_wrover_kit', '/dev/boards/esp_wrover_kit', id='esp_wrover_kit'), | ||
pytest.param('/dev/boards/esp32_azure_iot_kit', '/dev/boards/esp32_azure_iot_kit', id='esp32_azure_iot_kit'), | ||
pytest.param('/dev/boards/m5dial', '/dev/boards/m5dial', id='m5dial'), | ||
pytest.param('/dev/boards/m5stack_core', '/dev/boards/m5stack_core', id='m5stack_core'), | ||
pytest.param('/dev/boards/m5stack_core_2', '/dev/boards/m5stack_core_2', id='m5stack_core_2'), | ||
pytest.param('/dev/boards/m5stack_core_s3', '/dev/boards/m5stack_core_s3', id='m5stack_core_s3'), | ||
pytest.param('/dev/boards/m5stack_core_s3_se', '/dev/boards/m5stack_core_s3_se', id='m5stack_core_s3_se'), | ||
] | ||
) | ||
|
||
|
||
# Check marker with params and test ID | ||
def pytest_collection_modifyitems(config, items): | ||
for item in items: | ||
marker_option = "[" + config.getoption("-m") + "]" | ||
if marker_option not in item.nodeid: | ||
item.add_marker(pytest.mark.skip(reason="Not for selected params")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
import pytest | ||
from pytest_embedded import Dut | ||
|
||
|
||
@pytest.mark.esp_box_3 | ||
@pytest.mark.esp32_p4_function_ev_board | ||
@pytest.mark.esp32_c3_lcdkit | ||
@pytest.mark.esp32_s3_eye | ||
@pytest.mark.esp32_s3_lcd_ev_board | ||
@pytest.mark.esp32_s3_lcd_ev_board_2 | ||
@pytest.mark.esp32_s3_usb_otg | ||
@pytest.mark.esp_wrover_kit | ||
@pytest.mark.m5dial | ||
@pytest.mark.m5stack_core | ||
@pytest.mark.m5stack_core_2 | ||
@pytest.mark.m5stack_core_s3 | ||
@pytest.mark.m5stack_core_s3_se | ||
def test_display_example(dut: Dut) -> None: | ||
dut.expect_exact('example: Display LVGL animation') | ||
dut.expect_exact('main_task: Returned from app_main()') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD | ||
# SPDX-License-Identifier: CC0-1.0 | ||
|
||
import pytest | ||
from pytest_embedded import Dut | ||
|
||
|
||
@pytest.mark.esp_box_3 | ||
@pytest.mark.esp32_p4_function_ev_board | ||
@pytest.mark.esp32_s3_eye | ||
@pytest.mark.esp32_s3_lcd_ev_board | ||
@pytest.mark.esp32_s3_lcd_ev_board_2 | ||
@pytest.mark.m5dial | ||
@pytest.mark.m5stack_core_s3 | ||
@pytest.mark.m5stack_core_s3_se | ||
def test_display_example(dut: Dut) -> None: | ||
dut.expect_exact('app_main: Display LVGL demo') | ||
dut.expect_exact('main_task: Returned from app_main()') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.