From 420dd62918478dea50b4ca7f2a54ee7c7ff45281 Mon Sep 17 00:00:00 2001 From: shripad621git Date: Thu, 16 Jan 2025 16:36:19 +0530 Subject: [PATCH] .gitlab-ci.yml: Post the memory numbers with esp32c3 --- .gitlab-ci.yml | 9 +++++++++ tools/ci/post_results.py | 10 +++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2c12bd12b..3c05fc4e9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -342,6 +342,7 @@ build_esp_matter_examples_pytest_C2_idf_v5_1: echo "Not a Merge Request pipeline. Skipping post_results.py." fi + build_ext_plat_c6_thread_controller_examples: extends: - .build_examples_template @@ -394,6 +395,14 @@ build_esp_matter_examples: - python tools/ci/build_apps.py ./examples --no_pytest --parallel-count ${CI_NODE_TOTAL:-1} --parallel-index ${CI_NODE_INDEX:-1} + - | + if [ "$CI_PIPELINE_SOURCE" == "merge_request_event" ] && [ "${CI_NODE_INDEX:-1}" -eq 2 ]; then + python tools/ci/post_results.py --chip esp32c3 --job_name "build_esp_matter_examples 2/2" --ref_map_file light_mr_base.map --example "light" + else + echo "Not a Merge Request pipeline. Skipping post_results.py." + fi + + parallel: 2 build_nopytest_remaining_examples_manual: diff --git a/tools/ci/post_results.py b/tools/ci/post_results.py index 02a95ebf2..2c43dbdd8 100644 --- a/tools/ci/post_results.py +++ b/tools/ci/post_results.py @@ -24,7 +24,7 @@ def fetch_pipeline_for_commit(commit_sha, branch_name="main"): response.raise_for_status() pipelines = response.json() if not pipelines: - raise ValueError(f"No pipeline found for commit: {commit_sha} on branch: {branch_name}") + raise ValueError(f"No pipeline found for commit: {commit_sha} on branch: {branch_name}.") return pipelines[0]['id'] # Fetch the versions for the gitlab MR. @@ -55,11 +55,11 @@ def download_ref_map_file(chip_name, job_id, output_file): f.write(chunk) # Locate the map file artifact for the current pipeline. -def locate_current_map_file(example): - pattern = f"examples/{example}/build*/{example}.map" +def locate_current_map_file(chip, example): + pattern = f"examples/{example}/build_{chip}_default/{example}.map" artifact_file_paths = glob.glob(pattern, recursive=True) if not artifact_file_paths: - raise FileNotFoundError("No map file found!") + raise FileNotFoundError("No map file found for the example {example} with target chip {chip}") return artifact_file_paths[0] # Execute esp_idf_size diff command to find increase/decrease in firmware size. @@ -113,8 +113,8 @@ def main(): if not target_job_id: raise ValueError("Target job not found.") + current_map_file = locate_current_map_file(args.chip, args.example) download_ref_map_file(args.chip, target_job_id, args.ref_map_file) - current_map_file = locate_current_map_file(args.example) size_diff_output = execute_idf_size_command(args.ref_map_file, current_map_file) post_results_to_gitlab_mr(size_diff_output, args.chip, args.example)