Skip to content

Commit a6091df

Browse files
committed
Merge branch 'ci/upload-build-size-artifacts' into 'master'
ci: ensure binary size artifacts are uploaded in Build Stage Child pipeline via artifacts_handler script. See merge request espressif/esp-idf!33577
2 parents ffa74e3 + 397fdb5 commit a6091df

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

tools/ci/dynamic_pipelines/scripts/child_pipeline_build_apps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
check_app_dependencies=True,
6767
parallel_count=args.parallel_count,
6868
parallel_index=args.parallel_index,
69-
collect_size_info='size_info_@p.txt',
69+
collect_size_info='size_info.txt',
7070
collect_app_info=args.collect_app_info,
7171
junitxml=args.junitxml,
7272
copy_sdkconfig=True,

tools/ci/dynamic_pipelines/templates/.dynamic_jobs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
--collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
3838
--modified-components ${MR_MODIFIED_COMPONENTS}
3939
--junitxml "build_summary_${CI_JOB_NAME_SLUG}.xml"
40+
- run_cmd python tools/ci/artifacts_handler.py upload --type size_reports
4041

4142
.dynamic_target_test_template:
4243
extends:

tools/ci/idf_ci/uploader.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from idf_build_apps.utils import rmdir
1717
from idf_ci_utils import IDF_PATH
1818
from idf_pytest.constants import DEFAULT_BUILD_LOG_FILENAME
19+
from idf_pytest.constants import DEFAULT_SIZE_JSON_FILENAME
1920

2021

2122
class AppDownloader:
@@ -60,9 +61,6 @@ class AppUploader(AppDownloader):
6061
ArtifactType.LOGS: [
6162
DEFAULT_BUILD_LOG_FILENAME,
6263
],
63-
ArtifactType.SIZE_REPORTS: [
64-
'size.json',
65-
],
6664
}
6765

6866
def __init__(self, pipeline_id: t.Union[str, int, None] = None) -> None:
@@ -108,12 +106,13 @@ def upload_app(self, app_build_path: str, artifact_type: t.Optional[ArtifactType
108106
else:
109107
upload_types = [artifact_type]
110108

109+
# Upload of size.json files is handled by GitLab CI via "artifacts_handler.py" script.
111110
print(f'Uploading {app_build_path} {[k.value for k in upload_types]} to minio server')
112111
for upload_type in upload_types:
113112
uploaded |= self._upload_app(app_build_path, upload_type)
114113

115114
if uploaded:
116-
rmdir(app_build_path, exclude_file_patterns=DEFAULT_BUILD_LOG_FILENAME)
115+
rmdir(app_build_path, exclude_file_patterns=[DEFAULT_BUILD_LOG_FILENAME, DEFAULT_SIZE_JSON_FILENAME])
117116

118117
def _download_app(self, app_build_path: str, artifact_type: ArtifactType) -> None:
119118
app_path, build_dir = os.path.split(app_build_path)

tools/ci/idf_pytest/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@
153153
'tools/ci/ignore_build_warnings.txt',
154154
]
155155
DEFAULT_BUILD_LOG_FILENAME = 'build_log.txt'
156+
DEFAULT_SIZE_JSON_FILENAME = 'size.json'
156157

157158

158159
class CollectMode(str, Enum):

tools/ci/idf_pytest/script.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
from .constants import CollectMode
2626
from .constants import DEFAULT_BUILD_LOG_FILENAME
2727
from .constants import DEFAULT_CONFIG_RULES_STR
28+
from .constants import DEFAULT_SIZE_JSON_FILENAME
2829
from .constants import PytestCase
2930
from .plugin import IdfPytestEmbedded
3031

@@ -162,7 +163,7 @@ def get_all_apps(
162163
build_dir='build_@t_@w',
163164
config_rules_str=config_rules_str or DEFAULT_CONFIG_RULES_STR,
164165
build_log_filename=DEFAULT_BUILD_LOG_FILENAME,
165-
size_json_filename='size.json',
166+
size_json_filename=DEFAULT_SIZE_JSON_FILENAME,
166167
check_warnings=True,
167168
manifest_rootpath=IDF_PATH,
168169
compare_manifest_sha_filepath=compare_manifest_sha_filepath,

0 commit comments

Comments
 (0)