Skip to content

Commit a4118c2

Browse files
committed
Changes after review
1 parent 225367d commit a4118c2

File tree

4 files changed

+28
-39
lines changed

4 files changed

+28
-39
lines changed

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

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,14 @@ 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+
${{
176+
(contains(github.event.pull_request.labels.*.name, 'Run benchmark') ||
177+
contains(inputs.WFType, 'Build + Tests + Benchmark') ||
178+
github.ref_name == 'master')
179+
&& ''
180+
|| '--ignore=examples/display_lvgl_benchmark'
181+
}}
174182
runs-on: [self-hosted, Linux, bspwall]
175183
container:
176184
image: python:3.11-bookworm
@@ -185,24 +193,15 @@ jobs:
185193
env:
186194
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi/"
187195
run: |
188-
echo "PYTEST_BENCHMARK_IGNORE=--ignore='examples/display_lvgl_benchmark'" >> $GITHUB_ENV
189196
pip install --prefer-binary cryptography pytest-embedded pytest-embedded-serial-esp pytest-embedded-idf pytest-custom_exit_code
190197
- name: Download latest results
191198
uses: actions/download-artifact@v4
192199
with:
193200
pattern: benchmark_*
194201
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"
203202
- name: Run apps
204203
run: |
205-
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 }}
204+
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 }} ${{ env.PYTEST_BENCHMARK_IGNORE }}
206205
- name: Upload test results
207206
uses: actions/upload-artifact@v4
208207
if: always()
@@ -247,7 +246,8 @@ jobs:
247246
uses: EnricoMi/publish-unit-test-result-action@v2
248247
with:
249248
files: test_results/**/*.xml
250-
- name: Find test result files
249+
- name: Find benchmark result files
250+
if: (contains(github.event.pull_request.labels.*.name, 'Run benchmark') || contains(inputs.WFType, 'Build + Tests + Benchmark') || github.ref_name == 'master')
251251
id: find_files
252252
run: |
253253
OUTPUT_FILE="combined_benchmarks.md"
@@ -269,6 +269,7 @@ jobs:
269269
270270
echo "output_file=$OUTPUT_FILE" >> "$GITHUB_ENV"
271271
- name: Comment PR
272+
if: (contains(github.event.pull_request.labels.*.name, 'Run benchmark') || contains(inputs.WFType, 'Build + Tests + Benchmark') || github.ref_name == 'master')
272273
uses: thollander/actions-comment-pull-request@v3
273274
with:
274275
comment-tag: benchmark_results

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
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 "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 "main.c"
3+
INCLUDE_DIRS ".")

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'),

0 commit comments

Comments
 (0)