Skip to content

Commit 4f32c0f

Browse files
committed
Changes after review
1 parent 225367d commit 4f32c0f

File tree

5 files changed

+23
-38
lines changed

5 files changed

+23
-38
lines changed

.github/workflows/build-run-applications.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ jobs:
171171
TEST_RESULT_NAME: test_results_${{ matrix.runner.target }}_${{ matrix.runner.marker }}_${{ matrix.idf_ver }}
172172
BENCHMARK_RESULT_NAME: benchmark_${{ matrix.runner.target }}_${{ matrix.runner.marker }}_${{ matrix.idf_ver }}
173173
TEST_RESULT_FILE: test_results_${{ matrix.runner.target }}_${{ matrix.runner.marker }}_${{ matrix.idf_ver }}.xml
174+
PYTEST_BENCHMARK_IGNORE: >-
175+
${{ (contains(join(github.event.pull_request.labels.*.name, ','), 'Run benchmark') ||
176+
contains(inputs.WFType, 'Build + Tests + Benchmark') ||
177+
github.ref_name == 'master')
178+
? ''
179+
: "--ignore=examples/display_lvgl_benchmark" }}
174180
runs-on: [self-hosted, Linux, bspwall]
175181
container:
176182
image: python:3.11-bookworm
@@ -185,21 +191,12 @@ jobs:
185191
env:
186192
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
187193
run: |
188-
echo "PYTEST_BENCHMARK_IGNORE=--ignore='examples/display_lvgl_benchmark'" >> $GITHUB_ENV
189194
pip install --prefer-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pytest-custom_exit_code
190195
- name: Download latest results
191196
uses: actions/download-artifact@v4
192197
with:
193198
pattern: benchmark_*
194199
path: benchmark/
195-
- name: Set ignores
196-
if: contains(github.event.pull_request.labels.*.name, 'Run benchmark') || contains(inputs.WFType, 'Build + Tests + Benchmark') || github.ref_name == 'master'
197-
id: set_ignores
198-
run: |
199-
echo "PYTEST_BENCHMARK_IGNORE=" >> $GITHUB_ENV
200-
- name: Pull
201-
run: |
202-
git pull --rebase origin ${{ github.head_ref }} || echo "No remote changes to rebase"
203200
- name: Run apps
204201
run: |
205202
pytest --suppress-no-test-exit-code --ignore-glob '*/managed_components/*' --ignore=.github ${{ env.PYTEST_BENCHMARK_IGNORE }} --junit-xml=${{ env.TEST_RESULT_FILE }} --target=${{ matrix.runner.target }} -m ${{ matrix.runner.marker }} --build-dir=build_${{ matrix.runner.runs-on }}

examples/display_lvgl_benchmark/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
# Display LVGL Benchmark
22

3-
This example shows LVGL internal benchmark demo.
3+
This example runs the LVGL benchmark demo to measure graphical performance on Espressif and M5Stack boards. It is used in CI for selected pull requests (based on labels) and after merging changes into the master branch.
4+
5+
## Main Features
6+
- Can be triggered by adding the "Run benchmark" label to a PR.
7+
- The measured values in a PR are compared against the master branch and posted as a comment, highlighting any differences.
8+
- Benchmark results for the master branch are stored in BSP releases.
49

510
## How to use the example
611

12+
This example can be used as standalone example too.
13+
714
### Hardware Required
815

916
* ESP32-S3-LCD-EV-Board or ESP32-S3-LCD-EV-Board-2

examples/display_lvgl_benchmark/pytest_display_lvgl_benchmark.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
22
# SPDX-License-Identifier: CC0-1.0
33

4-
import os
54
import datetime
65
import json
76
from pathlib import Path
@@ -32,11 +31,8 @@ def write_json_file(board, data):
3231
repo_root = Path(__file__).resolve().parent
3332
while repo_root.name != "esp-bsp" and repo_root.parent != repo_root:
3433
repo_root = repo_root.parent
35-
file_path = f"{repo_root}/bsp/{board}/benchmark.json"
36-
try:
37-
os.remove(file_path)
38-
except OSError:
39-
pass
34+
file_path = repo_root / "bsp" / board / "benchmark.json"
35+
file_path.unlink(missing_ok=True)
4036
try:
4137
with open(file_path, "a") as file:
4238
file.write(data)
@@ -84,11 +80,10 @@ def test_example(dut: Dut, request) -> None:
8480
dut.expect_exact('app_main: Display LVGL demo')
8581
dut.expect_exact('main_task: Returned from app_main()')
8682

87-
try:
88-
os.remove("benchmark_" + board + ".md")
89-
os.remove("benchmark_" + board + ".json")
90-
except OSError:
91-
pass
83+
file_path = "benchmark_" + board + ".md"
84+
file_path.unlink(missing_ok=True)
85+
file_path = "benchmark_" + board + ".json"
86+
file_path.unlink(missing_ok=True)
9287

9388
output = {
9489
"date": date.strftime('%d.%m.%Y %H:%M'),
Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
set(LV_DEMO_DIR "")
2-
set(LV_DEMOS_SOURCES "")
3-
if(CONFIG_LV_USE_DEMO_BENCHMARK)
4-
list(APPEND LV_DEMO_DIR ../managed_components/lvgl__lvgl/demos)
5-
file(GLOB_RECURSE LV_DEMOS_SOURCES ${LV_DEMO_DIR}/*.c)
6-
endif()
7-
81
idf_component_register(
9-
SRCS "dispaly_lvgl_demos_main.c" ${LV_DEMOS_SOURCES}
10-
INCLUDE_DIRS "." ${LV_DEMO_DIR})
11-
12-
if(CONFIG_LV_USE_DEMO_BENCHMARK)
13-
set_source_files_properties(
14-
${LV_DEMOS_SOURCES}
15-
PROPERTIES COMPILE_OPTIONS
16-
-DLV_LVGL_H_INCLUDE_SIMPLE)
17-
endif()
2+
SRCS "display_lvgl_demos_main.c"
3+
INCLUDE_DIRS ".")

examples/display_lvgl_demos/partitions.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
33
nvs, data, nvs, 0x9000, 0x6000,
44
phy_init, data, phy, 0xf000, 0x1000,
5-
factory, app, factory, 0x10000, 0x160000,
5+
factory, app, factory, 0x10000, 0x200000,

0 commit comments

Comments
 (0)